Skip to content

Commit 0b7fd07

Browse files
committed
Fix false cache_lifetime usage in xml layouts #16086
1 parent 4504c5b commit 0b7fd07

File tree

2 files changed

+1
-14
lines changed

2 files changed

+1
-14
lines changed

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,14 +1064,10 @@ 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) {
10771073
return null;

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)