When I ran my page through an unclosed tag checker I noticed that the only errors I got came from the paragraph add buttons. I searched and found this bit of code in InlineParagraphsWidget.php on line 821:
if ($drop_button) {
$elements['add_more']['add_more_button_' . $machine_name]['#prefix'] = '<li>';
$elements['add_more']['add_more_button_' . $machine_name]['#suffix'] = '<li>';
}Of course this should be:
if ($drop_button) {
$elements['add_more']['add_more_button_' . $machine_name]['#prefix'] = '<li>';
$elements['add_more']['add_more_button_' . $machine_name]['#suffix'] = '</li>';
}
(the suffix should be </li> instead of <li>)
Created a patch for this.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | paragraphs-incorrect-li-tag-2778409-8.patch | 753 bytes | zerolab |
| #4 | Paragraphs__fix_closing__li__tag_for_dropdown_buttons_v2.patch | 879 bytes | flyke |
| Paragraphs__fix_closing__li__tag_for_dropdown_buttons.patch | 913 bytes | flyke |
Comments
Comment #2
zerolab commentedCan you re-roll the patch to have relative URLs.
htdocs/modules/contrib/paragraphs/src/Plugin/Field/FieldWidget/InlineParagraphsWidget.phpshould really besrc/Plugin/Field/FieldWidget/InlineParagraphsWidget.php.Also, do change the status to "Needs review" when adding a patch.
Comment #3
flyke commentedComment #4
flyke commentedOk I didn't know about the relative urls, the patch file is auto generated with PHP Storm.
I have modified the url now in this patch in the first line
From this:
Index: htdocs/modules/contrib/paragraphs/src/Plugin/Field/FieldWidget/InlineParagraphsWidget.phpto this:
Index: src/Plugin/Field/FieldWidget/InlineParagraphsWidget.phpand changed the status of this issue to 'needs review' as requested
Is that what you meant ? Or do I need to change lines 6 and 7 as well ?
to:
?
Comment #6
zerolab commentedFrom the testbot:
PHP 7 & MySQL 5.5, D8.3 Patch failed to applyYes, all paths must be relative. See https://www.drupal.org/node/1054616 for a very useful guide.
Other than that it looks good to me.
Comment #7
johnchqueIndeed, really nice catch. We just need a patch that applies :)
Comment #8
zerolab commentedTo speed things up, here's a patch that applies
Comment #10
miro_dietikerYeah, unclean markup is a real problem...
Committing.
Comment #14
miro_dietiker