Commit a7fccaae authored by catch's avatar catch

Issue #2230055 by tim.plunkett: Views handlers should not be initialized during route building.

parent a83352a1
......@@ -139,10 +139,7 @@ protected function getRoute($view_id, $display_id) {
// page arguments so the argument actually comes through.
$arg_counter = 0;
$this->view->initHandlers();
$view_arguments = (array) $this->view->argument;
$argument_ids = array_keys($view_arguments);
$argument_ids = array_keys((array) $this->getOption('arguments'));
$total_arguments = count($argument_ids);
$argument_map = array();
......@@ -247,10 +244,6 @@ public function alterRoutes(RouteCollection $collection) {
$route = $this->getRoute($view_id, $display_id);
$path = $route->getPath();
// Load the argument IDs from the view executable.
$view_arguments = (array) $this->view->argument;
$argument_ids = array_keys($view_arguments);
// Replace the path with the original parameter names and add a mapping.
$argument_map = array();
// We assume that the numeric ids of the parameters match the one from
......@@ -281,9 +274,6 @@ public function executeHookMenuLinkDefaults(array &$existing_links) {
// views_arg_load -- which lives in views.module.
$bits = explode('/', $this->getOption('path'));
$page_arguments = array($this->view->storage->id(), $this->display['id']);
$this->view->initHandlers();
$view_arguments = $this->view->argument;
// Replace % with %views_arg for menu autoloading and add to the
// page arguments so the argument actually comes through.
......
......@@ -188,8 +188,6 @@ public function testCollectRoutesWithNamedParameters() {
/** @var \Drupal\views\ViewExecutable|\PHPUnit_Framework_MockObject_MockObject $view */
list($view) = $this->setupViewExecutableAccessPlugin();
$view->expects($this->once())
->method('initHandlers');
$view->argument = array();
$view->argument['nid'] = $this->getMockBuilder('Drupal\views\Plugin\views\argument\ArgumentPluginBase')
->disableOriginalConstructor()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment