Commit cf88744b authored by paulocs's avatar paulocs Committed by paulocs

Issue #3156610 by DeaOm, paulocs, loze: Core block weight not respected when...

Issue #3156610 by DeaOm, paulocs, loze: Core block weight not respected when using a context block reaction
parent a9ed1512
......@@ -123,6 +123,14 @@ class ContextBlockPageVariant extends VariantBase implements PageVariantInterfac
foreach ($this->contextManager->getActiveReactions('blocks') as $reaction) {
if ($reaction->includeDefaultBlocks()) {
$build = NestedArray::mergeDeep($this->getBuildFromBlockLayout(), $build);
// Gives the system_main block the same weight as from block layout.
$build['content']['#sorted'] = FALSE;
foreach ($build['content'] as $key => $blockId) {
if (isset($blockId['#plugin_id']) && $blockId['#plugin_id'] == 'system_main_block') {
$build['content']['system_main']['#weight'] = isset($blockId['#weight']) ? $blockId['#weight'] : 0;
break;
}
}
return $build;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment