Skip to content

Commit

Permalink
Merge pull request #20 from magento-mpi/public-pulls
Browse files Browse the repository at this point in the history
[Github] Merge public Github commits
  • Loading branch information
vpelipenko committed Jan 8, 2015
2 parents 4ce64b6 + f4089aa commit b68900d
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 11 deletions.
8 changes: 5 additions & 3 deletions app/code/Magento/Catalog/Helper/Product/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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('<esi:include src="%s" />', $url);
Expand Down
4 changes: 3 additions & 1 deletion app/code/Magento/Review/Controller/Product/ListAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/internal/Magento/Framework/View/Layout/Reader/Move.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function getSupportedNodes()
public function interpret(Context $readerContext, Layout\Element $currentElement)
{
$this->scheduleMove($readerContext->getScheduledStructure(), $currentElement);
return false;
return $this;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand All @@ -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'));
Expand Down

0 comments on commit b68900d

Please sign in to comment.