diff --git a/src/QUI/Bricks/Brick.php b/src/QUI/Bricks/Brick.php index 32934c3900053125f1aa356465670314d68b2660..cb70131a7d7250e6b8d138ff13ec5370e0069d80 100644 --- a/src/QUI/Bricks/Brick.php +++ b/src/QUI/Bricks/Brick.php @@ -247,15 +247,9 @@ public function check(): Brick protected function createBrickHash(): string { $attributes = $this->getAttributes(); - $hashParams = []; - - foreach ($attributes as $name => $value) { - if (\is_object($value)) { - continue; - } - - $hashParams[$name] = \serialize($value); - } + $hashParams = \array_filter($attributes, function ($entry) { + return \is_object($entry) === false; + }); $hash = \serialize($hashParams); $hash = \md5($hash); @@ -272,11 +266,16 @@ protected function createBrickHash(): string */ public function create(): string { + $settings = $this->getSettings(); + $settings = \array_filter($settings, function ($entry) { + return \is_object($entry) === false; + }); + $cacheName = Manager::getBrickCacheNamespace() .\md5($this->getType()) .'/' .$this->hash - .'/'.\md5(\serialize($this->getSettings())); + .'/'.\md5(\serialize($settings)); if ($this->getAttribute('cacheable')) { try {