Skip to content

Commit

Permalink
Fixed the rewrite controller not matching the route with ID 0
Browse files Browse the repository at this point in the history
  • Loading branch information
qzminski committed Nov 29, 2017
1 parent 99d021b commit f87b958
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Controller/RewriteController.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,11 @@ public function __construct(ConfigProviderInterface $configProvider, ContaoFrame
*/
public function indexAction(Request $request): Response
{
if (!$request->attributes->has('_url_rewrite') || !($rewriteId = $request->attributes->get('_url_rewrite'))) {
throw new RouteNotFoundException('There _url_rewrite attribute is missing');
if (!$request->attributes->has('_url_rewrite')) {
throw new RouteNotFoundException('The _url_rewrite attribute is missing');
}

$rewriteId = $request->attributes->get('_url_rewrite');
$config = $this->configProvider->find($rewriteId);

if (null === $config) {
Expand Down

0 comments on commit f87b958

Please sign in to comment.