Bug #34682

Radio Button missing checked on validation error

Added by Kira Backes almost 10 years ago. Updated about 8 years ago.

Under Review
Should have
Target version:
Start date:
Due date:
% Done:


Estimated time:
Has patch:


The checked state of a radio button is not properly checked in the case of a validation error, this should be checked by comparing the value to the lastSubmittedFormData


Updated by Bastian Waidelich almost 10 years ago

  • Category set to ViewHelpers
  • Status changed from New to Needs Feedback

Can you provide more details please (code snippet, version(s) used, ..). This should work.
Is this maybe related to #33628 ?



Updated by Daniel Siepmann almost 9 years ago

Perhaps it's the bug described in my blog post? http://blog.layne-obserdia.de/post/fix-radio-and-checkbox-for-fluid#comment-795695300
There is a bug fix in the post.

Or is this another issue? I noticed that submitted checkboxes and radio buttons aren't selected anymore.

So e.g. the checkbox is not selected initial.
I check it, submit the form and the form will be displayed again, on validation error, then the checkbox is no more checked.

I just fixed it for the rewritten property mapper and got the submitted value and did a compare.


Updated by Benno Weinzierl over 8 years ago

This bug only happens for radio buttons with name="something" and not for radio buttons specified with property="something".

Looking at the code it seems almost like a intentional behaviour:

        if ($checked === NULL && $this->isObjectAccessorMode()) {
            if ($this->hasMappingErrorOccured()) {
                $propertyValue = $this->getLastSubmittedFormData();
            } else {
                $propertyValue = $this->getPropertyValue();

                // no type-safe comparison by intention
            $checked = $propertyValue == $valueAttribute;

$this->isObjectAccessorMode() is the problem...


Updated by Gerrit Code Review over 8 years ago

  • Status changed from Needs Feedback to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/22272


Updated by Gerrit Code Review about 8 years ago

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

Also available in: Atom PDF