diff --git a/app/code/Magento/Catalog/Helper/Product/View.php b/app/code/Magento/Catalog/Helper/Product/View.php index 1973e8fbf0951..8b38045df59d6 100644 --- a/app/code/Magento/Catalog/Helper/Product/View.php +++ b/app/code/Magento/Catalog/Helper/Product/View.php @@ -116,24 +116,26 @@ public function initProductLayout(ResultPage $resultPage, $product, $params = nu $pageConfig->setPageLayout($settings->getPageLayout()); } + $urlSafeSku = rawurlencode($product->getSku()); + // Load default page handles and page configurations if ($params && $params->getBeforeHandles()) { foreach ($params->getBeforeHandles() as $handle) { $resultPage->addPageLayoutHandles( - ['id' => $product->getId(), 'sku' => $product->getSku(), 'type' => $product->getTypeId()], + ['id' => $product->getId(), 'sku' => $urlSafeSku, 'type' => $product->getTypeId()], $handle ); } } $resultPage->addPageLayoutHandles( - ['id' => $product->getId(), 'sku' => $product->getSku(), 'type' => $product->getTypeId()] + ['id' => $product->getId(), 'sku' => $urlSafeSku, 'type' => $product->getTypeId()] ); if ($params && $params->getAfterHandles()) { foreach ($params->getAfterHandles() as $handle) { $resultPage->addPageLayoutHandles( - ['id' => $product->getId(), 'sku' => $product->getSku(), 'type' => $product->getTypeId()], + ['id' => $product->getId(), 'sku' => $urlSafeSku, 'type' => $product->getTypeId()], $handle ); } diff --git a/app/code/Magento/PageCache/Model/Observer/ProcessLayoutRenderElement.php b/app/code/Magento/PageCache/Model/Observer/ProcessLayoutRenderElement.php index fd266341f782b..159afc6e90ed4 100644 --- a/app/code/Magento/PageCache/Model/Observer/ProcessLayoutRenderElement.php +++ b/app/code/Magento/PageCache/Model/Observer/ProcessLayoutRenderElement.php @@ -37,7 +37,7 @@ protected function _wrapEsi( 'page_cache/block/esi', [ 'blocks' => json_encode([$block->getNameInLayout()]), - 'handles' => urlencode(json_encode($layout->getUpdate()->getHandles())) + 'handles' => json_encode($layout->getUpdate()->getHandles()) ] ); return sprintf('', $url); diff --git a/app/code/Magento/Review/Controller/Product/ListAction.php b/app/code/Magento/Review/Controller/Product/ListAction.php index 9669b04f91c7c..9774547e52779 100644 --- a/app/code/Magento/Review/Controller/Product/ListAction.php +++ b/app/code/Magento/Review/Controller/Product/ListAction.php @@ -25,8 +25,10 @@ protected function _initProductLayout($product) $pageConfig->setPageLayout($product->getPageLayout()); } $update = $this->_view->getLayout()->getUpdate(); + + $urlSafeSku = rawurlencode($product->getSku()); $this->_view->addPageLayoutHandles( - ['id' => $product->getId(), 'sku' => $product->getSku(), 'type' => $product->getTypeId()] + ['id' => $product->getId(), 'sku' => $urlSafeSku, 'type' => $product->getTypeId()] ); $this->_view->loadLayoutUpdates(); diff --git a/lib/internal/Magento/Framework/View/Layout/Reader/Container.php b/lib/internal/Magento/Framework/View/Layout/Reader/Container.php index cf392399edb8c..230e6bd9c6cd5 100644 --- a/lib/internal/Magento/Framework/View/Layout/Reader/Container.php +++ b/lib/internal/Magento/Framework/View/Layout/Reader/Container.php @@ -86,7 +86,8 @@ public function interpret(Context $readerContext, Layout\Element $currentElement default: break; } - return $this->readerPool->interpret($readerContext, $currentElement); + $this->readerPool->interpret($readerContext, $currentElement); + return $this; } /** diff --git a/lib/internal/Magento/Framework/View/Layout/Reader/Move.php b/lib/internal/Magento/Framework/View/Layout/Reader/Move.php index 9d0fe73d2b066..e9b1c6185838b 100644 --- a/lib/internal/Magento/Framework/View/Layout/Reader/Move.php +++ b/lib/internal/Magento/Framework/View/Layout/Reader/Move.php @@ -34,7 +34,7 @@ public function getSupportedNodes() public function interpret(Context $readerContext, Layout\Element $currentElement) { $this->scheduleMove($readerContext->getScheduledStructure(), $currentElement); - return false; + return $this; } /** diff --git a/lib/internal/Magento/Framework/View/Layout/Reader/Remove.php b/lib/internal/Magento/Framework/View/Layout/Reader/Remove.php index 3d0a9522e1146..3f5cfcce00093 100644 --- a/lib/internal/Magento/Framework/View/Layout/Reader/Remove.php +++ b/lib/internal/Magento/Framework/View/Layout/Reader/Remove.php @@ -36,6 +36,6 @@ public function interpret(Context $readerContext, Layout\Element $currentElement { $scheduledStructure = $readerContext->getScheduledStructure(); $scheduledStructure->setElementToRemoveList((string)$currentElement->getAttribute('name')); - return false; + return $this; } } diff --git a/lib/internal/Magento/Framework/View/Page/Config/Reader/Body.php b/lib/internal/Magento/Framework/View/Page/Config/Reader/Body.php index 95311e008f587..2d779eb0fb10f 100644 --- a/lib/internal/Magento/Framework/View/Page/Config/Reader/Body.php +++ b/lib/internal/Magento/Framework/View/Page/Config/Reader/Body.php @@ -63,10 +63,11 @@ public function interpret( /** @var \Magento\Framework\View\Layout\Element $element */ foreach ($bodyElement as $element) { if ($element->getName() === self::BODY_ATTRIBUTE) { - $this->setBodyAttributeTosStructure($readerContext, $element); + $this->setBodyAttributeToStructure($readerContext, $element); } } - return $this->readerPool->interpret($readerContext, $bodyElement); + $this->readerPool->interpret($readerContext, $bodyElement); + return $this; } /** @@ -76,7 +77,7 @@ public function interpret( * @param Layout\Element $element * @return $this */ - protected function setBodyAttributeTosStructure(Layout\Reader\Context $readerContext, Layout\Element $element) + protected function setBodyAttributeToStructure(Layout\Reader\Context $readerContext, Layout\Element $element) { if ($element->getAttribute('name') == PageConfig::BODY_ATTRIBUTE_CLASS) { $readerContext->getPageConfigStructure()->setBodyClass($element->getAttribute('value'));