diff --git a/core/modules/block/src/BlockViewBuilder.php b/core/modules/block/src/BlockViewBuilder.php index a7cb441..351410a 100644 --- a/core/modules/block/src/BlockViewBuilder.php +++ b/core/modules/block/src/BlockViewBuilder.php @@ -219,11 +219,13 @@ public static function preRender($build) { // "is the" block, and in particular, #attributes and #contextual_links is // information about the *entire* block. Therefore, we must move these // properties from $content and merge them into the top-level element. - foreach (array('#attributes', '#contextual_links') as $property) { - if (isset($content[$property])) { - $build[$property] += $content[$property]; - unset($content[$property]); - } + if (isset($content['#contextual_links'])) { + $build['#contextual_links'] += $content['#contextual_links']; + unset($content['#contextual_links']); + } + if (isset($content['#wrapper_attributes'])) { + $build['#attributes'] += $content['#wrapper_attributes']; + unset($content['#wrapper_attributes']); } $build['content'] = $content; }