Component: Classes/ViewHelpers/Misc/PrefillMultiFieldViewHelper.php
Setup: a checkbox field with this setting:
So three options with option 2 being preselected.
How to reproduce:
- select option 1
- submit form
- then
- either trigger a validation error (so the form re-renders)
- or come back from confirmation view (so the form re-renders)
Expected: only option 1 is checked.
Actual: options 1 and 2 are both checked.
Root cause: buildSelectedValue() chains prefill sources per-option with if (!$selected) guards. For option 2, all comparison methods (isFromMail, isFromMarker, …) return false (submitted 1 != 2), so the chain falls through to isFromPrefillValue(), which just returns the static * flag:
protected function isFromPrefillValue(): bool
{
return (bool)$this->options[$this->index]['selected'];
}
It ignores whether the user already submitted a value for the field. Same flaw affects isFromTypoScriptContentObject/Raw and isFromSession. The sibling PrefillFieldViewHelper avoids this by resolving one field-level value with empty($value) guards.
TYPO3 13.
EXT:powermail 13.2
Component:
Classes/ViewHelpers/Misc/PrefillMultiFieldViewHelper.phpSetup: a checkbox field with this setting:
So three options with option 2 being preselected.
How to reproduce:
Expected: only option 1 is checked.
Actual: options 1 and 2 are both checked.
Root cause:
buildSelectedValue()chains prefill sources per-option withif (!$selected)guards. For option 2, all comparison methods (isFromMail, isFromMarker, …) return false (submitted 1 != 2), so the chain falls through toisFromPrefillValue(), which just returns the static * flag:It ignores whether the user already submitted a value for the field. Same flaw affects
isFromTypoScriptContentObject/RawandisFromSession. The siblingPrefillFieldViewHelperavoids this by resolving one field-level value withempty($value)guards.TYPO3 13.
EXT:powermail 13.2