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.

Comments

flyke created an issue. See original summary.

zerolab’s picture

Version: 8.x-1.0-rc5 » 8.x-1.x-dev
Status: Active » Needs work

Can you re-roll the patch to have relative URLs. htdocs/modules/contrib/paragraphs/src/Plugin/Field/FieldWidget/InlineParagraphsWidget.php should really be src/Plugin/Field/FieldWidget/InlineParagraphsWidget.php.

Also, do change the status to "Needs review" when adding a patch.

flyke’s picture

Status: Needs work » Needs review
flyke’s picture

Ok 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.php
to this:
Index: src/Plugin/Field/FieldWidget/InlineParagraphsWidget.php

and 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 ?

--- htdocs/modules/contrib/paragraphs/src/Plugin/Field/FieldWidget/InlineParagraphsWidget.php	(revision 6f57dad7a6bc9849ada59c689bd4ca439e6f7be1)
+++ htdocs/modules/contrib/paragraphs/src/Plugin/Field/FieldWidget/InlineParagraphsWidget.php	(revision )

to:

--- src/Plugin/Field/FieldWidget/InlineParagraphsWidget.php	(revision 6f57dad7a6bc9849ada59c689bd4ca439e6f7be1)
+++ src/Plugin/Field/FieldWidget/InlineParagraphsWidget.php	(revision )

?

Status: Needs review » Needs work
zerolab’s picture

From the testbot: PHP 7 & MySQL 5.5, D8.3 Patch failed to apply

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

johnchque’s picture

Indeed, really nice catch. We just need a patch that applies :)

zerolab’s picture

Status: Needs work » Needs review
StatusFileSize
new753 bytes

To speed things up, here's a patch that applies

Status: Needs review » Needs work

The last submitted patch, 8: paragraphs-incorrect-li-tag-2778409-8.patch, failed testing.

miro_dietiker’s picture

Priority: Normal » Major
Status: Needs work » Fixed

Yeah, unclean markup is a real problem...

Committing.

Status: Fixed » Needs work

The last submitted patch, 8: paragraphs-incorrect-li-tag-2778409-8.patch, failed testing.

The last submitted patch, 8: paragraphs-incorrect-li-tag-2778409-8.patch, failed testing.

miro_dietiker’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

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