Skip to content

Commit bb9a652

Browse files
author
Stanislav Idolov
authored
ENGCOM-2647: [Forwardport] Fix false cache_lifetime usage in xml layouts #17350
2 parents acd9947 + 1736b9d commit bb9a652

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1074,7 +1074,7 @@ protected function getCacheLifetime()
10741074

10751075
$cacheLifetime = $this->getData('cache_lifetime');
10761076
if (false === $cacheLifetime || null === $cacheLifetime) {
1077-
return $cacheLifetime;
1077+
return null;
10781078
}
10791079

10801080
return (int)$cacheLifetime;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,9 @@ public function getCacheLifetimeDataProvider()
290290
'dataFromCache' => 'dataFromCache',
291291
'dataForSaveCache' => '',
292292
'expectsDispatchEvent' => $this->exactly(2),
293-
'expectsCacheLoad' => $this->once(),
293+
'expectsCacheLoad' => $this->never(),
294294
'expectsCacheSave' => $this->never(),
295-
'expectedResult' => 'dataFromCache',
295+
'expectedResult' => '',
296296
],
297297
[
298298
'cacheLifetime' => 120,

0 commit comments

Comments
 (0)