Skip to content

Commit 214f37f

Browse files
ENGCOM-1979: Fix false cache_lifetime usage in xml layouts #16086
2 parents 82f4707 + 0b7fd07 commit 214f37f

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

lib/internal/Magento/Framework/View/Element/AbstractBlock.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,17 +1064,13 @@ protected function getCacheTags()
10641064
/**
10651065
* Get block cache life time
10661066
*
1067-
* @return int|bool|null
1067+
* @return int|null
10681068
*/
10691069
protected function getCacheLifetime()
10701070
{
1071-
if (!$this->hasData('cache_lifetime')) {
1072-
return null;
1073-
}
1074-
10751071
$cacheLifetime = $this->getData('cache_lifetime');
10761072
if (false === $cacheLifetime || null === $cacheLifetime) {
1077-
return $cacheLifetime;
1073+
return null;
10781074
}
10791075

10801076
return (int)$cacheLifetime;

lib/internal/Magento/Framework/View/Test/Unit/Element/AbstractBlockTest.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -287,15 +287,6 @@ public function getCacheLifetimeDataProvider()
287287
'expectsCacheSave' => $this->never(),
288288
'expectedResult' => '',
289289
],
290-
[
291-
'cacheLifetime' => false,
292-
'dataFromCache' => 'dataFromCache',
293-
'dataForSaveCache' => '',
294-
'expectsDispatchEvent' => $this->exactly(2),
295-
'expectsCacheLoad' => $this->once(),
296-
'expectsCacheSave' => $this->never(),
297-
'expectedResult' => 'dataFromCache',
298-
],
299290
[
300291
'cacheLifetime' => 120,
301292
'dataFromCache' => 'dataFromCache',

0 commit comments

Comments
 (0)