diff --git a/core/modules/views/src/Plugin/views/display/PathPluginBase.php b/core/modules/views/src/Plugin/views/display/PathPluginBase.php index 175c41b..0fe53ad 100644 --- a/core/modules/views/src/Plugin/views/display/PathPluginBase.php +++ b/core/modules/views/src/Plugin/views/display/PathPluginBase.php @@ -245,6 +245,10 @@ public function alterRoutes(RouteCollection $collection) { // Ensure that we don't override a route which is already controlled by // views. if (!$route->hasDefault('view_id') && ('/' . $view_path == $route_path)) { + // The path variables array may have arbitrary keys, so take just the + // values to ensure we have a simple numeric array starting from 0. + $parameters = array_values($route->compile()->getPathVariables()); + // @todo Figure out whether we need to merge some settings (like // requirements). @@ -259,9 +263,6 @@ public function alterRoutes(RouteCollection $collection) { $path = $route->getPath(); // Replace the path with the original parameter names and add a mapping. $argument_map = array(); - // The path variables array may have arbitrary keys, so take just the - // values to ensure we have a simple numeric array starting from 0. - $parameters = array_values($route->compile()->getPathVariables()); // We assume that the numeric ids of the parameters match the one from // the view argument handlers. foreach ($parameters as $position => $parameter_name) {