Problem/Motivation
After upgrading to Drupal 11.3.1 from 11.2.10, I noticed that if there are multiple BigPipe placeholders with identical IDs, only one seems to get replaced. The insert() command in big_pipe.commands.js currently only performs its action for a single target matching the selector, which seems to be a change from what happened before.
Steps to reproduce
1. Create two identical render arrays, both of which use #create_placeholder to make a placeholder.
2. Ensure that BigPipe is being used to render the content for the placeholders (log in, clear caches, etc.).
3. Load the page, and notice that only one of the placeholders has been replaced, instead of all of them being replaced.
Proposed resolution
Modify the insert() command function in core/modules/big_pipe/js/big_pipe.commands.js to use htmx.findAll() to locate every target matching the selector, and then loop over all the targets and apply the action to each.
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | bigpipe.patch | 1.78 KB | artem_kondra |
Issue fork drupal-3564880
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3564880-bigpipe-placeholders-with
changes, plain diff MR !14298
Comments
Comment #4
artem_kondra commentedComment #6
drumlin44 commentedThe patch in #4 works for me -- thanks!
Comment #7
quietone commentedChanges are made on 11.x first and then backported.
Comment #8
scott_euser commentedThis seemed to sort the issue for us as well. Moving to NW because it needs an MR and I imagine some test coverage to demonstrate.
Priority-wise perhaps this is 'major' unless we consider disabling big pipe a valid alternative?
Comment #9
catchDefinitely major.
Comment #12
godotislateConverted patch to MR and added test: https://git.drupalcode.org/project/drupal/-/merge_requests/14298
Test-only failure: https://git.drupalcode.org/issue/drupal-3564880/-/jobs/7945791
Comment #13
longwaveAdded a question, otherwise the solution looks correct to me.
Comment #14
fathershawnThe tests are clearly passing. I also manually compared the behavior of
big_pipe_test.big_pipe_test_multi_occurrencemanually with both11.3.2and the MR branch. The problem and the fix are double verified!Comment #16
volegerCan confirm, with the MR patch, I can finally observe the replacement of the bigpipe placeholder with the user.toolbar_link_builder:renderToolbarLinks lazy builder markup on Drupal 11.3.2 project and Gin theme.
Comment #17
catchCommitted/pushed to main and cherry-picked to 11.x and 11.3.x, thanks!