A element name property definded by Typoscript may have different name in the frontend. After submitting the form, the names from
Typoscript and the POTS request can not be mapped.
My solution is to standardize element name properties on both sides. At runtime when the objects are created and named
and use the same name for the rendering.
This solution concerns currently only program execution and not the backend wizard.
More details:
Form rendering:
\TYPO3\CMS\Form\Domain\Factory\TypoScriptFactory->reconstituteElement
This function creates the Elements and set the "name" property of the php objects by Typoscript property "name".
Later the attributes for the element are created.
The value of the "name" attribute are also the "name" property defined by Typoscript.
\TYPO3\CMS\Form\Domain\Model\Attribute\NameAttribute->getValue
This function return a unified value of the "name" attribute. This unified string is used for the html "name" property.
This means spaces are replaced by hypens and non-word characters are removed.
A Typoscript like this
10 = TEXTLINE
10 {
name = test 1 : /
label {
value = xxx
}
}
results in a html element like this
<input id="field-2" type="text" value="xxx" name="tx_form[test-1--]">
After submitting the form the confirmation page or the Mail is rendered:
\TYPO3\CMS\Form\Domain\Factory\TypoScriptFactory->reconstituteElement
This function creates the Elements and set the "name" property of the php objects by Typoscript property "name".
Later "forms" try to map the Typoscript property "name" to the incomming POST data with the function "checkFilterAndSetIncomingDataFromRequest".
This mapping fails because name by typoscript is "test 1 : /" and the name in the POST request is "test-1--".
This results later in a PHP error.