#98225Add class attribute to EXT:form form-tag results in exception
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
Reviews 2
History 512
-
Stefan Froemken commented <span data-processor="relativetime" data-value="2022-08-29T09:53:36+00:00" > 08/29/22, 09:53 </span>
-
Garvin Hicking commented and changed status
NewNeeds Feedback <span data-processor="relativetime" data-value="2024-06-14T10:25:14+00:00" > 06/14/24, 10:25 </span>Do you have a suggestion on how to reword this and would like to make a PR? :-)
-
Gerrit Code Review pushed patch set 1 for main to change 84727 status
Needs FeedbackUnder Review <span data-processor="relativetime" data-value="2024-06-16T11:22:17+00:00" > 06/16/24, 11:22 </span> -
Gerrit Code Review pushed patch set 2 for main to change 84727 <span data-processor="relativetime" data-value="2024-06-16T11:39:45+00:00" > 06/16/24, 11:39 </span>
-
Stefan Froemken commented <span data-processor="relativetime" data-value="2024-06-16T11:58:05+00:00" > 06/16/24, 11:58 </span>
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.
-
Gerrit Code Review pushed patch set 3 for main to change 84727 <span data-processor="relativetime" data-value="2024-06-17T17:58:46+00:00" > 06/17/24, 17:58 </span>
-
Gerrit Code Review pushed patch set 4 for main to change 84727 <span data-processor="relativetime" data-value="2024-06-22T06:15:53+00:00" > 06/22/24, 06:15 </span>
-
Gerrit Code Review pushed patch set 5 for main to change 84727 <span data-processor="relativetime" data-value="2024-06-22T06:18:20+00:00" > 06/22/24, 06:18 </span>
-
Gerrit Code Review pushed patch set 6 for main to change 84727 <span data-processor="relativetime" data-value="2024-06-22T09:52:13+00:00" > 06/22/24, 09:52 </span>
-
Gerrit Code Review pushed patch set 1 for 12.4 to change 85454 <span data-processor="relativetime" data-value="2024-08-02T08:16:37+00:00" > 08/02/24, 08:16 </span>
-
Stefan Froemken commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2024-08-02T08:20:08+00:00" > 08/02/24, 08:20 </span>Applied in changeset commit:71175081b6c35592e1ae70d0dbdf8fb4d8fa9645.
-
Benni Mack changed status
ResolvedClosed <span data-processor="relativetime" data-value="2024-10-15T09:30:27+00:00" > 10/15/24, 09:30 </span>
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”:
https://docs.typo3.org/c/typo3/cms-form/main/en-us/search.html?q=fluidAdditionalAttributes&check_keywords=yes&area=default
Maybe that should be updated somewhere in the documentation.