Skip to content

Commit

Permalink
Merge branch '6.10'
Browse files Browse the repository at this point in the history
  • Loading branch information
andrerom committed Jul 26, 2017
2 parents e57d4d4 + 4258e0c commit 745b87c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion eZ/Bundle/EzPublishCoreBundle/Routing/DefaultRouter.php
Expand Up @@ -16,6 +16,7 @@
use eZ\Publish\Core\MVC\Symfony\SiteAccess\URILexer;
use Symfony\Bundle\FrameworkBundle\Routing\Router;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Exception\RouteNotFoundException;
use Symfony\Component\Routing\Matcher\RequestMatcherInterface;

/**
Expand Down Expand Up @@ -95,7 +96,13 @@ public function generate($name, $parameters = array(), $referenceType = self::AB
unset($parameters['siteaccess']);
}

$url = parent::generate($name, $parameters, $referenceType);
try {
$url = parent::generate($name, $parameters, $referenceType);
} catch (RouteNotFoundException $e) {
// Switch back to original context, for next links generation.
$this->setContext($originalContext);
throw $e;
}

// Now putting back SiteAccess URI if needed.
if ($isSiteAccessAware && $siteAccess && $siteAccess->matcher instanceof URILexer) {
Expand Down

0 comments on commit 745b87c

Please sign in to comment.