Bug #98225
closedAdd class attribute to EXT:form form-tag results in exception
100%
Description
Hello Form-Team,
I just try to add a css class to form-tag.
type: Form identifier: newEvent label: Create a new event prototypeName: standard renderingOptions: submitButtonLabel: Submit properties: fluidAdditionalAttributes: class: withtip frame-indent renderables:
In Form.html of EXT:form I have found that line:
additionalAttributes="{formvh:translateElementProperty(element: form, property: 'fluidAdditionalAttributes')}"
So I was optimistic that it should work, but it results in:
(1/1) #1325697085 InvalidArgumentException The options "properties" were not allowed (allowed were: "rendererClassName, renderingOptions, finishers, formEditor, label, variants")
Stefan
Updated by Stefan Froemken about 2 years ago
Argh, for form-tag the option "fluidAdditionalAttributes" is part of "renderingOptions". That's very confusing, as for all other elements this option is part of "properties". Have a look into the preview of all these search results. They all start with "properties.fluidAdditionalAttributes":
Maybe that should be updated somewhere in the documentation.
Updated by Garvin Hicking 5 months ago
- Status changed from New to Needs Feedback
Do you have a suggestion on how to reword this and would like to make a PR? :-)
Updated by Gerrit Code Review 5 months ago
- Status changed from Needs Feedback to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84727
Updated by Gerrit Code Review 5 months ago
Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84727
Updated by Stefan Froemken 5 months ago
Hello. I have extracted the FormDefinition section of EXT:form documentation into its own documentation section as FormDefinition is IMO not part of a form element. Sure, both are extending the AbstractRenderable, but under the hood FormDefinition allows a completely different set of options.
FormElements:
ArrayUtility::assertAllArrayKeysAreValid( $options, ['label', 'defaultValue', 'properties', 'renderingOptions', 'validators', 'formEditor', 'variants'] );
Form:
ArrayUtility::assertAllArrayKeysAreValid( $options, ['rendererClassName', 'renderingOptions', 'finishers', 'formEditor', 'label', 'variants'] );
As you can see Form does not allow option properties.
While processing the fluidAdditionalAttributes there is a check to differ between it's a Form or FormElement. For FormElement the well known properties are used, but if it's a Form it internally switches to retrieve the properties from renderingOptions.
I have kept the header links to not damage the internal and external linking.
Updated by Gerrit Code Review 5 months ago
Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84727
Updated by Gerrit Code Review 5 months ago
Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84727
Updated by Gerrit Code Review 5 months ago
Patch set 5 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84727
Updated by Gerrit Code Review 5 months ago
Patch set 6 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84727
Updated by Gerrit Code Review 4 months ago
Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/85454
Updated by Stefan Froemken 4 months ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 71175081b6c35592e1ae70d0dbdf8fb4d8fa9645.