From 494fa58be9c4be94abdd2b93df9a2fd2c6210961 Mon Sep 17 00:00:00 2001 From: Yuriy Tkachenko Date: Wed, 13 Jun 2018 11:00:59 +0300 Subject: [PATCH 1/3] Fix false cache_lifetime usage in xml layouts --- lib/internal/Magento/Framework/View/Element/AbstractBlock.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/View/Element/AbstractBlock.php b/lib/internal/Magento/Framework/View/Element/AbstractBlock.php index 0ffa9dce7f730..b2f857bf29f45 100644 --- a/lib/internal/Magento/Framework/View/Element/AbstractBlock.php +++ b/lib/internal/Magento/Framework/View/Element/AbstractBlock.php @@ -1074,7 +1074,7 @@ protected function getCacheLifetime() $cacheLifetime = $this->getData('cache_lifetime'); if (false === $cacheLifetime || null === $cacheLifetime) { - return $cacheLifetime; + return null; } return (int)$cacheLifetime; From 1124fb5a5272baf1572a7acbf80bdf43218b53fb Mon Sep 17 00:00:00 2001 From: Jignesh Baldha Date: Tue, 7 Aug 2018 16:18:08 +0530 Subject: [PATCH 2/3] Fixed unit test according to changes --- .../View/Test/Unit/Element/AbstractBlockTest.php | 9 --------- 1 file changed, 9 deletions(-) diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Element/AbstractBlockTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Element/AbstractBlockTest.php index 70233c0196dc5..ced26f082fe27 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Element/AbstractBlockTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Element/AbstractBlockTest.php @@ -285,15 +285,6 @@ public function getCacheLifetimeDataProvider() 'expectsCacheSave' => $this->never(), 'expectedResult' => '', ], - [ - 'cacheLifetime' => false, - 'dataFromCache' => 'dataFromCache', - 'dataForSaveCache' => '', - 'expectsDispatchEvent' => $this->exactly(2), - 'expectsCacheLoad' => $this->once(), - 'expectsCacheSave' => $this->never(), - 'expectedResult' => 'dataFromCache', - ], [ 'cacheLifetime' => 120, 'dataFromCache' => 'dataFromCache', From 105b7872320c837857789202c30be3a9ca33f70a Mon Sep 17 00:00:00 2001 From: Jignesh Baldha Date: Tue, 7 Aug 2018 18:39:02 +0530 Subject: [PATCH 3/3] Changed unit test according --- .../View/Test/Unit/Element/AbstractBlockTest.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Element/AbstractBlockTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Element/AbstractBlockTest.php index ced26f082fe27..5f7508438a6ed 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Element/AbstractBlockTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Element/AbstractBlockTest.php @@ -285,6 +285,15 @@ public function getCacheLifetimeDataProvider() 'expectsCacheSave' => $this->never(), 'expectedResult' => '', ], + [ + 'cacheLifetime' => false, + 'dataFromCache' => 'dataFromCache', + 'dataForSaveCache' => '', + 'expectsDispatchEvent' => $this->exactly(2), + 'expectsCacheLoad' => $this->never(), + 'expectsCacheSave' => $this->never(), + 'expectedResult' => '', + ], [ 'cacheLifetime' => 120, 'dataFromCache' => 'dataFromCache',