- Issue created by @bernardm28
- πΊπΈUnited States bernardm28 Tennessee
I'm not sure, I would imagine it would work as usual without it. However, bigpipe is considered best practice and significantly improved performance metrics.
https://docs.acquia.com/acquia-cloud-platform/performance/bigpipe
So i would imagine for those that don't use it they might run into this issue once they do. - πΊπΈUnited States mferanda
When I first saw this my thought was... js file! Against the theme rules. :)
Other problem is, this change feels less like normal Drupal theming and more like overriding a core issue. Did they actually introduce this with a note and instructions? Because again, from looking at that issue, it seems more like an oops that people discovered on 10.3. Then a scramble to figure out a solution. Mainly bypassing someone's mistake.
Having to put HTML into a js file seems really odd to me and out of place for Drupal norm.
On this, I'd lean toward documentation. That's of course if things are fine with bigpipe disabled. If bigpipe is enabled, maybe put a warning or such on the status page. That way, we allow the themer to add what they deem necessary on the subtheme. I can also put a note about this on the project front page.
I'll have to research this further.
- πΊπΈUnited States stevenlafl
This appears to be the correct solution, according to https://www.drupal.org/project/drupal/issues/3100083 π Add js message theme override to match Umami message markup Needs review
And the core issue: https://www.drupal.org/project/drupal/issues/3456176 π 10.3 upgrade now missing status-message theme suggestions Postponed
- πΊπΈUnited States stevenlafl
Here's a patch file that will apply (Drupal.org adds lines to the .info.yml files so they need the correct offsets for patches to work).
I've confirmed this solution is working.
- πΊπΈUnited States mferanda
Looks like there are people working to fix this in core.
https://www.drupal.org/project/drupal/issues/3396318 π AJAX MessageCommand markup and styling differs from Theme default Needs work
Like I said, there are things I'm avoiding in this theme. One is any js on the base and also trying to bandaid a core issue. The only thing I'd be fine doing is providing instructions for people to apply in their own subtheme. Of course, if they're using big pipe.
- πΊπΈUnited States JonMcL Brooklyn, NY
I just wandered into this today. It looks like the work on π AJAX MessageCommand markup and styling differs from Theme default Needs work is to improve the way the new MessageCommand renders commands that BigPipe has created. This will also improve how all AJAX JS messages are styled. For example, the "Oops, something went wrong. Check your browser's developer console for more details." message would potentially be styled correctly.
Catch is on π 10.3 upgrade now missing status-message theme suggestions Postponed suggesting that theme maintainers are supposed to implement styling in Drupal.theme.message and that would potentially solve the SystemMessagesBlock + BigPipe and any arbitrary calls to the new-ish MessageCommand AJAX Command ( https://www.drupal.org/node/3086403 β ). However, if I'm understanding things correctly, that would cause a theme maintainer to need to implement the styling and template in two places because some site may not be using BigPipe at all.
π 10.3 upgrade now missing status-message theme suggestions Postponed has two workarounds that appear to fix the issue.
- https://www.drupal.org/project/drupal/issues/3456176#comment-15661382 π 10.3 upgrade now missing status-message theme suggestions Postponed is a core patch that prevents BigPipe from moving the messages into the MessageCommand
- https://www.drupal.org/project/drupal/issues/3456176#comment-15710004 π 10.3 upgrade now missing status-message theme suggestions Postponed is a a simple preprocess function that forces the messages to be rendered before BigPipe gets control.
Until π AJAX MessageCommand markup and styling differs from Theme default Needs work shows more promise, we are going to go with the simple preprocess function in our sub theme.
- πΊπΈUnited States mferanda
@jonmcl How would you change this theme to reflect the preprocess function? Can you provide a change and demonstrate that it works?
- πΊπΈUnited States JonMcL Brooklyn, NY
@mferanda I added this to our sub_theme.theme file:
function sub_theme_preprocess_block__system_messages_block(&$variables): void { $variables['content'] = StatusMessages::renderMessages(); $variables['#cache']['max-age'] = 0; }
Unfortunately, I am now noticing that it doesn't work for the status_messages render element (
$form['messages'] = ['#type' => 'status_messages'];
). I tried to implement asub_theme_preprocess_status_messages
but it doesn't even get called when BigPipe is enabled.I may resort to the patch at https://www.drupal.org/project/drupal/issues/3456176#comment-15661382 π 10.3 upgrade now missing status-message theme suggestions Postponed