From ca7f9e58b5450e0637993040ef2fb835f63a29c7 Mon Sep 17 00:00:00 2001 From: Ben Tideswell Date: Tue, 7 Jun 2016 19:00:59 +0100 Subject: [PATCH 1/6] Fixed variable for containers --- lib/internal/Magento/Framework/View/Layout.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/internal/Magento/Framework/View/Layout.php b/lib/internal/Magento/Framework/View/Layout.php index 5e73497438423..0cc7decea27ae 100755 --- a/lib/internal/Magento/Framework/View/Layout.php +++ b/lib/internal/Magento/Framework/View/Layout.php @@ -469,7 +469,7 @@ public function renderElement($name, $useCache = true) $this->build(); if (!isset($this->_renderElementCache[$name]) || !$useCache) { if ($this->displayElement($name)) { - $this->_renderElementCache[$name] = $this->renderNonCachedElement($name); + $this->_renderElementCache[$name] = $this->renderNonCachedElement($name, $useCache); } else { return $this->_renderElementCache[$name] = ''; } @@ -508,7 +508,7 @@ protected function displayElement($name) * @return string * @throws \Exception */ - public function renderNonCachedElement($name) + public function renderNonCachedElement($name, $useCache = true) { $result = ''; try { @@ -517,7 +517,7 @@ public function renderNonCachedElement($name) } elseif ($this->isBlock($name)) { $result = $this->_renderBlock($name); } else { - $result = $this->_renderContainer($name); + $result = $this->_renderContainer($name, $useCache); } } catch (\Exception $e) { if ($this->appState->getMode() === AppState::MODE_DEVELOPER) { @@ -561,12 +561,12 @@ protected function _renderUiComponent($name) * @param string $name * @return string */ - protected function _renderContainer($name) + protected function _renderContainer($name, $useCache = true) { $html = ''; $children = $this->getChildNames($name); foreach ($children as $child) { - $html .= $this->renderElement($child); + $html .= $this->renderElement($child, $useCache); } if ($html == '' || !$this->structure->getAttribute($name, Element::CONTAINER_OPT_HTML_TAG)) { return $html; From 9adf4f3c8d3c0795254267bd35ddfc7d6964420a Mon Sep 17 00:00:00 2001 From: Ben Tideswell Date: Wed, 22 Jun 2016 19:51:31 +0100 Subject: [PATCH 2/6] Modified __ function to return string rather than object. --- app/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/functions.php b/app/functions.php index 78eef9b883663..70b1862b5022a 100644 --- a/app/functions.php +++ b/app/functions.php @@ -18,5 +18,5 @@ function __() $argc = $argc[0]; } - return new \Magento\Framework\Phrase($text, $argc); + return (string)(new \Magento\Framework\Phrase($text, $argc)); } From 88739ef42e1416faae97cba6666b89e764f19d06 Mon Sep 17 00:00:00 2001 From: Ben Tideswell Date: Wed, 22 Jun 2016 19:54:18 +0100 Subject: [PATCH 3/6] Reverted __ function changes temporarily --- app/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/functions.php b/app/functions.php index 70b1862b5022a..78eef9b883663 100644 --- a/app/functions.php +++ b/app/functions.php @@ -18,5 +18,5 @@ function __() $argc = $argc[0]; } - return (string)(new \Magento\Framework\Phrase($text, $argc)); + return new \Magento\Framework\Phrase($text, $argc); } From a13b72398515e78ef078106c4d47a345b91db6d3 Mon Sep 17 00:00:00 2001 From: Ben Tideswell Date: Wed, 22 Jun 2016 20:22:31 +0100 Subject: [PATCH 4/6] Modified __ function to return a string rather than Phrase object. --- app/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/functions.php b/app/functions.php index 78eef9b883663..a22552954b128 100644 --- a/app/functions.php +++ b/app/functions.php @@ -18,5 +18,5 @@ function __() $argc = $argc[0]; } - return new \Magento\Framework\Phrase($text, $argc); + return (string)new \Magento\Framework\Phrase($text, $argc); } From a28010c39b3c2d9d3873f9a655684b3cb9cfbdae Mon Sep 17 00:00:00 2001 From: Ben Tideswell Date: Wed, 22 Jun 2016 20:24:35 +0100 Subject: [PATCH 5/6] Reverted Layout.php for pull request. --- lib/internal/Magento/Framework/View/Layout.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/internal/Magento/Framework/View/Layout.php b/lib/internal/Magento/Framework/View/Layout.php index 0cc7decea27ae..5e73497438423 100755 --- a/lib/internal/Magento/Framework/View/Layout.php +++ b/lib/internal/Magento/Framework/View/Layout.php @@ -469,7 +469,7 @@ public function renderElement($name, $useCache = true) $this->build(); if (!isset($this->_renderElementCache[$name]) || !$useCache) { if ($this->displayElement($name)) { - $this->_renderElementCache[$name] = $this->renderNonCachedElement($name, $useCache); + $this->_renderElementCache[$name] = $this->renderNonCachedElement($name); } else { return $this->_renderElementCache[$name] = ''; } @@ -508,7 +508,7 @@ protected function displayElement($name) * @return string * @throws \Exception */ - public function renderNonCachedElement($name, $useCache = true) + public function renderNonCachedElement($name) { $result = ''; try { @@ -517,7 +517,7 @@ public function renderNonCachedElement($name, $useCache = true) } elseif ($this->isBlock($name)) { $result = $this->_renderBlock($name); } else { - $result = $this->_renderContainer($name, $useCache); + $result = $this->_renderContainer($name); } } catch (\Exception $e) { if ($this->appState->getMode() === AppState::MODE_DEVELOPER) { @@ -561,12 +561,12 @@ protected function _renderUiComponent($name) * @param string $name * @return string */ - protected function _renderContainer($name, $useCache = true) + protected function _renderContainer($name) { $html = ''; $children = $this->getChildNames($name); foreach ($children as $child) { - $html .= $this->renderElement($child, $useCache); + $html .= $this->renderElement($child); } if ($html == '' || !$this->structure->getAttribute($name, Element::CONTAINER_OPT_HTML_TAG)) { return $html; From b784c7864df307f5e48e3e6eee46971c30407785 Mon Sep 17 00:00:00 2001 From: Ben Tideswell Date: Wed, 22 Jun 2016 20:25:27 +0100 Subject: [PATCH 6/6] Final fix --- app/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/functions.php b/app/functions.php index a22552954b128..78eef9b883663 100644 --- a/app/functions.php +++ b/app/functions.php @@ -18,5 +18,5 @@ function __() $argc = $argc[0]; } - return (string)new \Magento\Framework\Phrase($text, $argc); + return new \Magento\Framework\Phrase($text, $argc); }