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.

CommentFileSizeAuthor
#2 3098486-2.patch1.39 KBmradcliffe

Comments

ojchris37 created an issue. See original summary.

mradcliffe’s picture

Category: Support request » Bug report
Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new1.39 KB

Yeah, 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.

mradcliffe’s picture

Version: 8.x-2.0-alpha1 » 8.x-2.x-dev

Changing version.

mradcliffe’s picture

Status: Needs review » Fixed

Fixed in 8.x-2.x.

  • mradcliffe committed ef7013c on 8.x-2.x
    Issue #3098486 by mradcliffe, ojchris37: Fixes agreement form markup
    
mradcliffe’s picture

Status: Needs review » Fixed

Fixing again since somehow this got bumped back to Needs Review magically.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.