ContentBlock: Fixed nested caching detection

This commit is contained in:
Matias Griese
2018-12-11 16:08:58 +02:00
parent bac24cf520
commit 1ba785f28e

View File

@@ -29,7 +29,7 @@ class ContentBlock implements ContentBlockInterface
protected $content = '';
protected $blocks = [];
protected $checksum;
protected $cached;
protected $cached = true;
/**
* @param string $id
@@ -139,9 +139,6 @@ class ContentBlock implements ContentBlockInterface
$tokens = [];
$replacements = [];
foreach ($this->blocks as $block) {
if ($block->isCached() === false) {
$this->disableCache();
}
$tokens[] = $block->getToken();
$replacements[] = $block->toString();
}
@@ -188,7 +185,17 @@ class ContentBlock implements ContentBlockInterface
*/
public function isCached()
{
return $this->cached ?? true;
if (!$this->cached) {
return false;
}
foreach ($this->blocks as $block) {
if (!$block->isCached()) {
return false;
}
}
return true;
}
/**