Bug #17122
closed
flexform <eval>required</eval> on type "input" applies only on last input-field
Added by Timo Piatkowski over 17 years ago.
Updated over 9 years ago.
Category:
Backend User Interface
Description
can anyone confirm this?
Could be a problem in the array-creation of $this->requiredFields in class.t3lib_tceforms.php in the function getSingleField_typeInput where keys will be overwritten . . .
e.g.
data[tt_content]3[pi_flexform][data][sDEF][lDEF][ZXlogin][vDEF]
will be overwritten by:
data[tt_content]3[pi_flexform][data][sDEF][lDEF][ZXpasword][vDEF]
the result ist that only the field "ZXpassword" will be evaluated as required
(issue imported from #M5226)
Files
I got the same problem.
More, with a localization of a flexcontent.
Only de LAST localisation of the LAST input is really required.
otherfields can be bypassed from the moment the LAST localization of the last input is filled correctly.
I can confirm this with TYPO3 6.0 (master, last commit e5d2ba5e).
Put the three attached files into typo3conf/ext/flexformtest/
, enable the extension, add the plugin to a page and try to save.
TYPO3 will show an error message when both or only the second field is empty. It will not show an error message if the second input is filled out, but the first is empty - although both are required.
In typo3/sysext/backend/Classes/Form/FormEngine.php
, method getSingleField_typeInput
is called. It calls
registerRequiredProperty($type, $name, $value)
with
("field", "tt_content_254_pi_flexform", "data[tt_content][254][pi_flexform][data][sDEF][lDEF][field_input1][vDEF]")
This method registers the required field under its name:
$this->requiredFields[$name] = $value;
Now for both fields, the name is the same (tt_content_254_pi_flexform
), causing the requirement for the first field to be overwritten by the second one.
- Status changed from New to Under Review
We just tested it with the current master and can confirm that this applies also for TYPO3 6.2.
What about this issue? Idle for one year, now.
- Description updated (diff)
- Category set to Backend User Interface
- Status changed from Under Review to Accepted
- Priority changed from Should have to Must have
- Is Regression set to No
Since the patch was abandoned, I reset the ticket status
I can confirm this error. It doesn't depend on the input fields. I created elements with DCE and flux and they have the same error. Four required input fields and only the last returns an error. There is a gist https://gist.github.com/muex/e72b44c3c6bfd485e2cf with two fields and they don't have the same name, as anyone mentioned before.
this will probably not be fixed in 6.2 anymore. there was a lot of effort in 7 to improve the required handling and it is not possible to backport this stuff to 6.2.
verified: this is fixed in 7, but will not be changed in 6.2. i'll close the issue as 'won't fix' for 6.2 now.
- Status changed from Accepted to Closed
Also available in: Atom
PDF