Problem/Motivation
The markup on agreement forms creates a div that wraps the entire form under the "edit-agreement" id. It's intended that the agreement text, checkbox (if rendered) and button (if rendered) should be separate markup.
The terms of use text can get very long. In an attempt to see if a custom theme can be applied I notice the I agree form is somewhat embeded in the text. So you:
<DIV js-form-wrapper form-wrapper>
several <P></P> containing the text
<DIV js-form-item form-item js-form-type-checkbox form-item-agree js-form-item-agree> checkbox </div>
<div form-actions js-form-wrapper form-wrapper>submit button</div>
</div> (closing for js-form-wrapper form-wrapper)
Proposed resolution
Change the agreement container element to use #tree rendering, and set the #parents of the agree checkbox to ['agree'].
<DIV js-form-wrapper form-wrapper> containing the text </div>
<DIV js-form-item form-item js-form-type-checkbox form-item-agree js-form-item-agree> checkbox </div>
<div form-actions js-form-wrapper form-wrapper>submit button</div>
Remaining tasks
- See if the patch passes tests
User interface changes
Markup changes slightly, but did not have any significant effect on the defaults. This could affect some live sites trying to theme around the wonky markup.
API changes
No.
Data model changes
No.
Comments
Comment #2
mradcliffeYeah, something funky is going on with Drupal generating the markup when the container has #tree set to false.
I think setting tree to true, and then specifying the #parents for the agree checkbox should generate the correct markup.
Comment #3
mradcliffeChanging version.
Comment #4
mradcliffeFixed in 8.x-2.x.
Comment #6
mradcliffeFixing again since somehow this got bumped back to Needs Review magically.