Skip to content

Commit

Permalink
ENGCOM-1979: Fix false cache_lifetime usage in xml layouts #16086
Browse files Browse the repository at this point in the history
  • Loading branch information
VladimirZaets authored Jul 2, 2018
2 parents 82f4707 + 0b7fd07 commit 214f37f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
8 changes: 2 additions & 6 deletions lib/internal/Magento/Framework/View/Element/AbstractBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -1064,17 +1064,13 @@ protected function getCacheTags()
/**
* Get block cache life time
*
* @return int|bool|null
* @return int|null
*/
protected function getCacheLifetime()
{
if (!$this->hasData('cache_lifetime')) {
return null;
}

$cacheLifetime = $this->getData('cache_lifetime');
if (false === $cacheLifetime || null === $cacheLifetime) {
return $cacheLifetime;
return null;
}

return (int)$cacheLifetime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,15 +287,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',
Expand Down

0 comments on commit 214f37f

Please sign in to comment.