diff --git a/src/Entity/PageVariant.php b/src/Entity/PageVariant.php index 0f84589..97a4490 100644 --- a/src/Entity/PageVariant.php +++ b/src/Entity/PageVariant.php @@ -125,9 +125,9 @@ class PageVariant extends ConfigEntityBase implements PageVariantInterface { /** * An array of collected contexts. * - * @var \Drupal\Component\Plugin\Context\ContextInterface[] + * @var \Drupal\Component\Plugin\Context\ContextInterface[]|null */ - protected $availableContexts = []; + protected $availableContexts = NULL; /** * Static context references. diff --git a/src/Tests/PageConfigSchemaTest.php b/src/Tests/PageConfigSchemaTest.php index 2af9051..1b19e8c 100644 --- a/src/Tests/PageConfigSchemaTest.php +++ b/src/Tests/PageConfigSchemaTest.php @@ -50,7 +50,7 @@ public function testValidPageConfigSchema() { ], 'negate' => TRUE, 'context_mapping' => [ - 'node' => 'node', + 'node' => '@page_manager.route_param_context:node', ], ]); $page->save(); @@ -75,7 +75,7 @@ public function testValidPageConfigSchema() { 'page' => 'page', ], 'context_mapping' => [ - 'node' => 'node', + 'node' => '@page_manager.route_param_context:node', ], ]); diff --git a/src/Tests/PageNodeAccessTest.php b/src/Tests/PageNodeAccessTest.php index 91bf3be..df1a250 100644 --- a/src/Tests/PageNodeAccessTest.php +++ b/src/Tests/PageNodeAccessTest.php @@ -72,7 +72,7 @@ public function testUserRoleAccessCondition() { RoleInterface::AUTHENTICATED_ID => RoleInterface::AUTHENTICATED_ID, ], 'context_mapping' => [ - 'user' => 'current_user', + 'user' => '@user.current_user_context:current_user', ], ]); $this->page->save(); diff --git a/src/Tests/PageNodeSelectionTest.php b/src/Tests/PageNodeSelectionTest.php index 181f57f..b89c592 100644 --- a/src/Tests/PageNodeSelectionTest.php +++ b/src/Tests/PageNodeSelectionTest.php @@ -94,7 +94,7 @@ public function testAdmin() { 'view_mode' => 'default', 'region' => 'top', 'context_mapping' => [ - 'entity' => 'node', + 'entity' => '@page_manager.route_param_context:node', ], ]); $block_page_variant->addSelectionCondition([ @@ -103,7 +103,7 @@ public function testAdmin() { 'article' => 'article', ], 'context_mapping' => [ - 'node' => 'node', + 'node' => '@page_manager.route_param_context:node', ], ]); $block_page_variant->setWeight(-10);