Skip to content

Commit

Permalink
Fix not found nodetranslation and media in urlhelper
Browse files Browse the repository at this point in the history
  • Loading branch information
Danny van Wijk committed Oct 8, 2024
1 parent 30e1afc commit ac5fe8c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/Kunstmaan/NodeBundle/Helper/URLHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -149,8 +147,6 @@ private function getMedia($mediaId): array
);
$media = $stmt->fetchAssociative();

$this->mediaCache[$mediaId] = $media;

return $media;
return $this->mediaCache[$mediaId] = $media ?: [];
}
}

0 comments on commit ac5fe8c

Please sign in to comment.