Skip to content

Commit

Permalink
Fix notices about missing indices
Browse files Browse the repository at this point in the history
Make sure we have a requirements/_locale key in a route before blindly checking it against a string.
This would result in notices thrown about missing indices. If the key isn't set at all in the route, we
should just blindly apply the default.
  • Loading branch information
doenietzomoeilijk authored Oct 19, 2018
1 parent 7d3feed commit d47f14c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Frontend/LocalizedFrontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ protected function getConfigurationRoutes()
}

foreach ($routes as $name => &$route) {
if ($name !== 'preview' && $route['requirements']['_locale'] != 'none') {
if (
$name !== 'preview'
&& (!isset($route['requirements']['_locale']) || $route['requirements']['_locale'] != 'none')
) {
$route['path'] = '/{_locale}' . $route['path'];
$route['requirements']['_locale'] = $requirements;
}
Expand Down

0 comments on commit d47f14c

Please sign in to comment.