From 6adce46436d4f8930b0e0330b678270e49c32bbc Mon Sep 17 00:00:00 2001 From: John Locke Date: Wed, 2 Aug 2017 20:29:06 -0700 Subject: [PATCH] Set group context on all rewritten URLs, not just those in the group --- .../PurlContextOutboundPathProcessor.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/PathProcessor/PurlContextOutboundPathProcessor.php b/src/PathProcessor/PurlContextOutboundPathProcessor.php index 8a0950c..512b1ec 100644 --- a/src/PathProcessor/PurlContextOutboundPathProcessor.php +++ b/src/PathProcessor/PurlContextOutboundPathProcessor.php @@ -28,13 +28,13 @@ public function __construct(MatchedModifiers $matchedModifiers, ContextHelper $c public function processOutbound($path, &$options = array(), Request $request = NULL, BubbleableMetadata $bubbleable_metadata = NULL) { - if (array_key_exists('purl_context', $options) && $options['purl_context'] == false) { + if (count($this->matchedModifiers->getMatched()) && $bubbleable_metadata) { + $cacheContexts = $bubbleable_metadata->getCacheContexts(); + $cacheContexts[] = 'purl'; + $bubbleable_metadata->setCacheContexts($cacheContexts); + } - if (count($this->matchedModifiers->getMatched()) && $bubbleable_metadata) { - $cacheContexts = $bubbleable_metadata->getCacheContexts(); - $cacheContexts[] = 'purl'; - $bubbleable_metadata->setCacheContexts($cacheContexts); - } + if (array_key_exists('purl_context', $options) && $options['purl_context'] == false) { return $this->contextHelper->processOutbound( $this->matchedModifiers->createContexts(Context::EXIT_CONTEXT),