Actions
Task #69037
closedEpic #69036: EXT:form - Optimize layout rendering
EXT:form - Missing label leads to unrendered mandatory and error messages
Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Form Framework
Target version:
-
Start date:
2015-08-13
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Sprint Focus:
Description
Imagine the following snippet:
10 = TEXTLINE 10 { name = name }
Since no label is defined the whole label tag is not rendered. Due to this the mandatory and error messages are not rendered as well. It should be possible to work with empty labels since placeholders are working and could carry the "field description". As a solution one could think to do the following:
10 = FORM 10 { layout { label = <label><labelvalue /></label><mandatory /><error /> } }
Right now this is not possible. The following PHP errors occur:
Core: Error handler (FE): PHP Catchable Fatal Error: Argument 3 passed to TYPO3\CMS\Form\View\Form\Element\AbstractElementView::replaceNodeWithFragment() must be an instance of DOMNode, null given, called in sysext/form/Classes/View/Form/Element/AbstractElementView.php on line 139 and defined in sysext/form/Classes/View/Form/Element/AbstractElementView.php line 275 Core: Error handler (FE): PHP Warning: DOMDocument::loadXML(): Extra content at the end of the document in Entity, line: 1 in /sysext/form/Classes/View/Form/Element/AbstractElementView.php line 223
Updated by Björn Jacob about 9 years ago
- Subject changed from Forms: missing label leads to unrendered mandatory and error messages to EXT:form - Missing label leads to unrendered mandatory and error messages
- Category set to Form Framework
Updated by Björn Jacob about 9 years ago
- Status changed from New to Closed
This is no longer an issue. Just tested it with the following setup. Everythin is robust. Using no label is no problem anymore. Setting different overrides also works.
enctype = multipart/form-data method = post prefix = tx_form layout { #label = <label clas="global-override"><labelvalue /></label><mandatory /><error /> } form.layout { #label = <label class="form-override"><labelvalue /></label><mandatory /><error /> } 10 = TEXTLINE 10 { name = name } 20 = SUBMIT 20 { name = submit } rules { 10 = required 10.element = name }
Actions