diff --git a/src/Kunstmaan/NodeBundle/Helper/URLHelper.php b/src/Kunstmaan/NodeBundle/Helper/URLHelper.php index 8f8d12e537..743950261f 100644 --- a/src/Kunstmaan/NodeBundle/Helper/URLHelper.php +++ b/src/Kunstmaan/NodeBundle/Helper/URLHelper.php @@ -132,9 +132,7 @@ private function getNodeTranslation($nodeTranslationId): array ); $nodeTranslation = $stmt->fetchAssociative(); - $this->nodeTranslationCache[$nodeTranslationId] = $nodeTranslation; - - return $nodeTranslation; + return $this->nodeTranslationCache[$nodeTranslationId] = $nodeTranslation ?: []; } private function getMedia($mediaId): array @@ -149,8 +147,6 @@ private function getMedia($mediaId): array ); $media = $stmt->fetchAssociative(); - $this->mediaCache[$mediaId] = $media; - - return $media; + return $this->mediaCache[$mediaId] = $media ?: []; } }