In admin/structure/block, I have deleted all instances of the message block. But the block is still displayed in the content region... The only solution I could find is to unset the "messages" variable in preprocess_page: unset($vars['page']['content']['messages']);
I am not sure, but I think this problem is the same for all global block...

Comments

DuneBL created an issue. See original summary.

DuneBL’s picture

Of course, the same problem arise if I deactivate the block (instead of deleting it)

tim.plunkett’s picture

Status: Active » Closed (works as designed)

This is done purposefully in \Drupal\block\Plugin\DisplayVariant\BlockPageVariant::build()

Before #2289917: Convert "messages" page element into blocks, messages were not a block. When it was converted, it was made required.

Only the messages and the main content block are special-cased.

DuneBL’s picture

Issue summary: View changes

Many thanks for this usefull information.
But this not fit my use case: I need to display the message block from within a node temple (not a page template)
I nee this for layout purposes.
In my node template, I am displaying a de-activated message block
But in my preprocess page, I must unset($vars['page']['content']['messages']); which is not verry beautifull (but still working)