Skip to content

Commit

Permalink
NGSTACK-735: allow resolving location even if Site API is not enabled…
Browse files Browse the repository at this point in the history
… on the siteaccess
  • Loading branch information
pspanja committed Feb 14, 2023
1 parent 4b8357b commit 0bf57b0
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions bundle/Routing/GeneratorRouter.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,6 @@ public function generate(
array $parameters = [],
int $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH
): string {
$isSiteApiPrimaryContentView = $this->configResolver->getParameter('ng_site_api.site_api_is_primary_content_view');

if (!$isSiteApiPrimaryContentView) {
throw new RouteNotFoundException('Pass to the next router');
}

$location = $this->resolveLocation($name, $parameters);

Expand All @@ -84,7 +79,9 @@ public function generate(
$parameters[RouteObjectInterface::ROUTE_OBJECT],
);

if (isset($parameters['siteaccess'])) {
$isSiteApiPrimaryContentView = $this->configResolver->getParameter('ng_site_api.site_api_is_primary_content_view');

if (isset($parameters['siteaccess']) || !$isSiteApiPrimaryContentView) {
return $this->generator->generate($location, $parameters, $referenceType);
}

Expand Down

0 comments on commit 0bf57b0

Please sign in to comment.