Bug #70095

Epic #69955: Optimize new Extbase/ Fluid based rewrite of EXT:form

Bug #69957: EXT:form - Fix some problems with Container elements

EXT:form - Wrong Checkbox and Radiobutton handling

Added by Ralf Zimmermann over 3 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Form Framework
Target version:
Start date:
2015-09-24
Due date:
% Done:

100%

TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
Stabilization Sprint

Description

The Checkboxes and the Radiobuttons need a value at sending. If there are no values
i can not remap the data after submit / validation. To avoid this i set the values to {$elementName}-{$elementCounter} if there are no value argument is available.

Affected Parts:

  • form/Resources/Private/Partials/Compatibility/Confirmation/FlatElements/Checkbox.html
  • form/Resources/Private/Partials/Compatibility/Confirmation/FlatElements/Radio.html
  • form/Resources/Private/Partials/Compatibility/Show/FlatElements/Checkbox.html
  • form/Resources/Private/Partials/Compatibility/Show/FlatElements/Radio.html
  • form/Resources/Private/Partials/Default/Show/FlatElements/Checkbox.html
  • form/Resources/Private/Partials/Default/Show/FlatElements/Radio.html
  • form/Resources/Private/Partials/Default/Confirmation/FlatElements/Checkbox.html
  • form/Resources/Private/Partials/Default/Confirmation/FlatElements/Radio.html
  • TYPO3\CMS\Form\Hooks\HandleIncomingFormValues
    • the $modelValue is the value that is defined by typoscript. If the incoming date not match this value i look if the incomming data is {$elementName}-{$elementCounter}

Test:

Make a radio and / or checkboxes and give them no value (the wizard write this elements without)
If a validation fails, the checkboxes and radios must keep the checked state.
If you go to the confirmation, the labels of the checked elements must be shown.
If you go back to the form, the checkboxes and radios must keep the checked state.
If you send the mail, the mail must contain the labels of the checked elements.

ext_form_70095.png View (20.3 KB) Bjoern Jacob, 2015-09-28 13:27


Related issues

Related to TYPO3 Core - Bug #70122: EXT:form - Dropdown/Selectbox doesn't work in compatibility mode Closed 2015-09-25
Related to TYPO3 Core - Bug #70208: EXT:form - Problems with radiogroup in email Closed 2015-09-30

Associated revisions

Revision 45e22338 (diff)
Added by Ralf Zimmermann over 3 years ago

[BUGFIX] EXT:form - Wrong Checkbox and Radiobutton handling

Resolves: #70095
Releases: master
Change-Id: I55ba94d13a8aeb02858675d2924f1d8a75cea698
Reviewed-on: http://review.typo3.org/43543
Reviewed-by: Frans Saris <>
Tested-by: Frans Saris <>
Reviewed-by: Bjoern Jacob <>
Tested-by: Bjoern Jacob <>
Reviewed-by: Oliver Hader <>
Tested-by: Oliver Hader <>

History

#1 Updated by Gerrit Code Review over 3 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/43543

#2 Updated by Bjoern Jacob over 3 years ago

Example to test this issue.


enctype = multipart/form-data
method = post
prefix = tx_form
confirmation = 1
postProcessor {
    1 = mail
    1 {
        recipientEmail = mail@email.com
        senderEmail = mail@email.com
    }
}
10 = RADIO
10 {
    name = radio
    label {
        value = Radio
    }
}
20 = CHECKBOX
20 {
    name = checkbox
    label {
        value = Checkbox
    }
}
30 = CHECKBOXGROUP
30 {
    name = checkboxgroup1
    class = fieldset-subgroup
    legend {
        value = Checkbox group
    }
    10 = CHECKBOX
    10 {
        label {
            value = Checkbox 1
        }
    }
    20 = CHECKBOX
    20 {
        label {
            value = Checkbox 2
        }
    }
    30 = CHECKBOX
    30 {
        label {
            value = Checkbox 3
        }
    }
}
40 = RADIOGROUP
40 {
    name = radiogroup1
    class = fieldset-subgroup
    legend {
        value = Radio group
    }
    10 = RADIO
    10 {
        label {
            value = Radio 1
        }
    }
    20 = RADIO
    20 {
        label {
            value = Radio 2
        }
    }
    30 = RADIO
    30 {
        label {
            value = Radio 3
        }
    }
}
50 = SUBMIT
50 {
    name = submit
    value = Submit
}
rules {
    1 = required
    1 {
        breakOnError = 0
        showMessage = 1
        message = Required
        error = This field is required
        element = radio
    }
    2 = required
    2 {
        breakOnError = 0
        showMessage = 1
        message = Required
        error = This field is required
        element = checkbox
    }
    3 = required
    3 {
        breakOnError = 0
        showMessage = 1
        message = Required
        error = This field is required
        element = checkboxgroup1
    }
    4 = required
    4 {
        breakOnError = 0
        showMessage = 1
        message = Required
        error = This field is required
        element = radiogroup1
    }
}

#3 Updated by Nicole Cordes over 3 years ago

Thanks for providing the configuration to test the patch. It seems to work es expected, but I'm wondering of it is the intention, that the confirmation page shows nothing but the buttons to got back or confirm? I would have expected at least to see the labels even the value of the form elements are empty?!

#4 Updated by Ralf Zimmermann over 3 years ago

I installed a fresh TYPO3 CMS master and apply this patchset. I cannot reproduce this. I add the example typoscript to the wizard and the confirmation page show the labels of the checked checkboxes / radios. The hidden fields are also set.
The question is, whats the difference to your system?

#5 Updated by Bjoern Jacob over 3 years ago

Tested the current patchset again using the above mentioned configuration. I've created a new content element and pasted the code. Works for me on current master.

#6 Updated by Gerrit Code Review over 3 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/43543

#7 Updated by Ralf Zimmermann over 3 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#8 Updated by David Denicolo' over 3 years ago

don't know if the same issue but if I use a radiogroup i get in the email the labels plus the value, if the value is empty I get the automatic generated one.
that just in the email, for example without value:

Anrede Herr3

if I write the Herr as value in TS

Anrede HerrHerr

thanks

#9 Updated by Bjoern Jacob over 3 years ago

Hi David. Thx for your reply. Let's discuss this issue within a different issue. Pls see #70208. Could you provide your form setup (TypoScript)?

#10 Updated by Riccardo De Contardi over 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF