Skip to content

Commit

Permalink
Do not generate canonical URL if location ID does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
emodric committed May 14, 2024
1 parent 42accf0 commit dd3db6a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bundle/Handler/Literal/CanonicalUrl.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ public function getMetaTags($tagName, array $params = []): array
return [];
}

if ($content->contentInfo->mainLocationId === null) {
return [];
}

$value = $this->urlGenerator->generate(
UrlAliasRouter::URL_ALIAS_ROUTE_NAME,
[
Expand Down

0 comments on commit dd3db6a

Please sign in to comment.