Skip to content

Commit

Permalink
Merge pull request #3442 from insiders/urlhelper
Browse files Browse the repository at this point in the history
[NodeBundle] Fix not found nodetranslation and media in urlhelper
  • Loading branch information
acrobat authored Oct 13, 2024
2 parents 046ec17 + ac5fe8c commit bb0c5b0
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 bb0c5b0

Please sign in to comment.