diff --git a/core/modules/block/src/EventSubscriber/NodeRouteContext.php b/core/modules/block/src/EventSubscriber/NodeRouteContext.php index 9b74393..04eb339 100644 --- a/core/modules/block/src/EventSubscriber/NodeRouteContext.php +++ b/core/modules/block/src/EventSubscriber/NodeRouteContext.php @@ -44,7 +44,7 @@ public function onBlockActiveContext(BlockContextEvent $event) { if ($node = $this->routeMatch->getParameter('node')) { $context->setContextValue($node); } - $event->setContext('node', $context); + $event->setContext('node.node', $context); } elseif ($this->routeMatch->getRouteName() == 'node.add') { $node_type = $this->routeMatch->getParameter('node_type'); diff --git a/core/modules/block/src/Tests/BlockLanguageTest.php b/core/modules/block/src/Tests/BlockLanguageTest.php index 4acff54..6f22e68 100644 --- a/core/modules/block/src/Tests/BlockLanguageTest.php +++ b/core/modules/block/src/Tests/BlockLanguageTest.php @@ -136,7 +136,7 @@ public function testMultipleLanguageTypes() { // Enable a standard block and set visibility to French only. $block_id = strtolower($this->randomMachineName(8)); $edit = [ - 'visibility[language][context_mapping][language]' => 'language_interface', + 'visibility[language][context_mapping][language]' => 'language.language_interface', 'visibility[language][langcodes][fr]' => TRUE, 'id' => $block_id, 'region' => 'sidebar_first', @@ -158,7 +158,7 @@ public function testMultipleLanguageTypes() { // Change visibility to now depend on content language for this block. $edit = [ - 'visibility[language][context_mapping][language]' => 'language_content' + 'visibility[language][context_mapping][language]' => 'language.language_content' ]; $this->drupalPostForm('admin/structure/block/manage/' . $block_id, $edit, t('Save block')); diff --git a/core/modules/node/src/Tests/NodeBlockFunctionalTest.php b/core/modules/node/src/Tests/NodeBlockFunctionalTest.php index 9bc5054..2ff5981 100644 --- a/core/modules/node/src/Tests/NodeBlockFunctionalTest.php +++ b/core/modules/node/src/Tests/NodeBlockFunctionalTest.php @@ -117,6 +117,9 @@ public function testRecentNodeBlock() { $block = $this->drupalPlaceBlock('system_powered_by_block', array( 'visibility' => array( 'node_type' => array( + 'context_mapping' => array( + 'node' => 'node.node', + ), 'bundles' => array( 'article' => 'article', ),