Issue / Problem

I faced this issue when working with a “radix” theme on a druapl 10.3.2 website. Upon inspecting the status message block, instead of desired outcome shown in the green rectangle in the screenshot; that is: with hook suggestion and override twig template name suggestion). I’m getting what’s shown in the red rectange.

2025-08-13T111736

The issue issue as “prashant.c” described in issue 3456176 - #10:

2025-08-13T112611

Mitigation/Solution 1 - Theme Hook

The first solution is proposed in #17 comment under the issue, via creating a theme hook to control the rendering of the system message block:

In your yourThemeName.theme file, add the following:

1
2
3
4
5
6
<?php
    
use Drupal\Core\Render\Element\StatusMessages;
function yourtheme_preprocess_block__system_messages_block(&$variables){
  $variables['content'] = StatusMessages::renderMessages();
}

Mitigation/Solution 2 - BigPipeline

The second solution is proposed in #45 comment under the issue, via bypassing some portion of the code in the core/modules/big_pipe/src/Render/BigPipe.php file:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
           // Delete all messages that were generated during the rendering of this
           // placeholder, to render them in a BigPipe-optimized way.
-          $messages = $this->messenger->deleteAll();
-          foreach ($messages as $type => $type_messages) {
-            foreach ($type_messages as $message) {
-              $ajax_response->addCommand(new MessageCommand($message, NULL, ['type' => $type], FALSE));
-            }
-          }
+          // $messages = $this->messenger->deleteAll();
+          // foreach ($messages as $type => $type_messages) {
+          //  foreach ($type_messages as $message) {
+          //    $ajax_response->addCommand(new MessageCommand($message, NULL, ['type' => $type], FALSE));
+          //  }
+          //}
 
           // Push a fake request with the asset libraries loaded so far and
           // dispatch KernelEvents::RESPONSE event. This results in the

Outcome

Both approaches worked for me, and as a result I am able to create my own custom status-message.html.twig file my radix sub theme to customize how the system message get displayed:

2025-08-13T114400

Reference