From 459ca7dcbbeb27dce4eafb38ad12360b93b5cf78 Mon Sep 17 00:00:00 2001 From: William Hearn Date: Sat, 28 Sep 2019 13:09:17 -0400 Subject: [PATCH] feat(page_manager): Ignore panelizer routes --- src/EntityRouteProvider.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/EntityRouteProvider.php b/src/EntityRouteProvider.php index ed6f0bf..9cb59b8 100644 --- a/src/EntityRouteProvider.php +++ b/src/EntityRouteProvider.php @@ -81,7 +81,8 @@ final class EntityRouteProvider implements ContextProviderInterface { $route = $this->routeMatch->getRouteObject(); - if ($route && ($route->hasDefault('_entity_view') || $route->hasDefault('_core_context_entity'))) { + $ignore_routes = ['page_manager_page_variant']; + if ($route && !in_array($route->hasDefault('_entity_view'), $ignore_routes) && ($route->hasDefault('_entity_view') || $route->hasDefault('_core_context_entity'))) { list ($entity_type_id, $view_mode) = explode('.', $route->getDefault('_entity_view') ?: $route->getDefault('_core_context_entity')); $entity = $this->routeMatch->getParameter($entity_type_id); @@ -96,6 +97,7 @@ final class EntityRouteProvider implements ContextProviderInterface { $contexts = array_intersect_key($contexts, array_flip($unqualified_context_ids)); } + // Since the current route determines whether or not we have an entity // from which to extract contexts, we need to add the route cache context. $cache_metadata = new CacheableMetadata(); -- 2.20.1 (Apple Git-117)