Problem/Motivation
Trying to use #create_placeholder on a block causes blocks not to render at all in the Umami theme.
I did some debugging, and the #lazy_builder callback for those blocks gets called and works OK, but it seems like the block placeholder markup doesn't get into page markup at all, meaning there's nothing to replace. This is because Umami calls striptags in its page template, which when you have a bigpipe placeholder without any non-tag content, strips the entire thing.
Found in #3437499: Use placeholdering for more blocks.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Issue fork drupal-3439017
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:
- 3439017-umami-placeholders
changes, plain diff MR !7896
- 3439017-create-placeholder
changes, plain diff MR !7354
Comments
Comment #3
catchTheoretically we have test coverage for this, but I don't think it's testing the right thing:
This was added all the way back in the original issue #2543340: Convert BlockViewBuilder to use #lazy_builder (but don't yet let context-aware blocks be placeholdered).
Comment #4
catchGot suspicious that only umami tests were failing, surely we had more block test coverage than this, and then looked at Umami's page.tpl.php and the bug is in there :(.
Postponing this on #3437499: Use placeholdering for more blocks since I'll include the fix in there, but leaving this open in case we want to split it out or remove more of this logic other than the
striptags.Comment #5
wim leersDid you mean
core/profiles/demo_umami/themes/umami/templates/layout/page.html.twig?It's not obvious to me what the problem is. I'd bet it's
which appears to be a work-around for #953034: [meta] Themes improperly check renderable arrays when determining visibility? 🫣
Comment #7
catchExtracted the commit from and put up an MR.
It's the strip tags that's the problem - placeholder HTML doesn't have any content outside the HTML tag, so Umami just discards it.
Comment #9
catchComment #10
smustgrave commentedSeems unrelated to this change.
Question because I've similar code in the past. If you have debugging on then those conditions will now pass right? Due to the twig comments.
Comment #11
smustgrave commentedTo quote @catch from slack
So my concern in #10 is mute.
Will mark.
Comment #17
nod_Committed and pushed 1fd796042d to 11.x and a7a9469cdc to 11.0.x and a989b1dfc9 to 10.4.x and 8144350adb to 10.3.x. Thanks!