Hello,
i´m not sure if this bug is reported in the right issue-list, but i hope so.
I´m using Drupal 8.1.1. Today i enabled big-pipe for testing and i found this strange bug.
Scenario:
I have several menus in the header section combined to an unordered list. Each menu is in a block and in an list-element. My CSS works fine for anonymous and logged-in users.
When i enable big-pipe the menu block for the language-switcher will be surrounded by a div-element which destroys my CSS. All other blocks are same as without big-pipe.
Any ideas why this happen? I checked the twig-templates. They´re still looking good and i can´t find out when and why this div is added.
In the attachment you can see my basic header section. Maybe this will help
Best,
Phil_b
Comment | File | Size | Author |
---|---|---|---|
menu_structure.txt | 493 bytes | Phil_b |
Comments
Comment #2
Fabianx CreditAttribution: Fabianx as a volunteer and at Tag1 Consulting commentedMoving to the right queue.
Yes, indeed the DIVs are left on the page, when we replace the placeholder.
This could be solved by the custom templates for big pipe placeholders (other issue).
Or maybe you could change the div to be displayed as 'inline'. While we don't have a special class, I think there is a data attribute you could check for non-empty.
Maybe we should add a class?
@Wim: Thoughts?
Comment #3
Wim LeersAFAICT this is a bug in the AJAX system.
Comment #4
Wim LeersConfirmed. And yes, this is the AJAX system biting us.
BigPipe uses
\Drupal\Core\Ajax\ReplaceCommand
, which uses http://api.jquery.com/replaceWith/. But thanks to this stuff inajax.js
, we're left with that wrapping<div>
:This is therefore a duplicate of #736066: ajax.js insert command sometimes wraps content in a div, potentially producing invalid HTML and other bugs, which is a >6 year old major bug.
But let's keep this issue open, to make it easier for BigPipe users to find out about this problem. Marking as blocked on that issue, so that we can close both at the same time.
Comment #5
Wim LeersReported this issue at #736066-107: ajax.js insert command sometimes wraps content in a div, potentially producing invalid HTML and other bugs.
Comment #6
Wim LeersOh, hah, this exact problem has been reported before to BigPipe: #2654386: [PP-1] BigPipe uses AJAX system to insert new content, AJAX system adds a wrapping <div>, breaks theme. It just was still in the contrib module's issue queue. Moved it to Drupal core.
Comment #10
leymannxFound another occurrence of this bug when using https://www.drupal.org/project/blockgroup together with BigPipe. Empty
<div>
containers around all Block Groups when BigPipe enabled and logged in. Breaks CSS. Disabling BigPipe fixed it :'(Comment #11
Wim Leers#10: reported at #736066-262: ajax.js insert command sometimes wraps content in a div, potentially producing invalid HTML and other bugs, thanks for letting me know. (Note that you can work around it by tweaking your CSS selectors.)
#2913563: Facets blocks loaded with BigPipe wrapped in unwanted <div> due to bug in AJAX system was also just brought to my attention, that was yet another duplicate of this.
Comment #13
Wim Leers#736066: ajax.js insert command sometimes wraps content in a div, potentially producing invalid HTML and other bugs was finally fixed today!
That means this also was fixed automatically! 🎉