diff --git a/core/modules/views/src/ViewExecutable.php b/core/modules/views/src/ViewExecutable.php index 0a7136a..3c01adc 100644 --- a/core/modules/views/src/ViewExecutable.php +++ b/core/modules/views/src/ViewExecutable.php @@ -451,15 +451,18 @@ class ViewExecutable implements \Serializable { * The current user. * @param \Drupal\views\ViewsData $views_data * The views data. + * @param \Drupal\Core\Routing\RouteProviderInterface $route_provider + * The route provider. * @param \Drupal\Core\Utility\Token $token_utility * The global token utility. */ - public function __construct(ViewEntityInterface $storage, AccountInterface $user, ViewsData $views_data, Token $token_utility) { + public function __construct(ViewEntityInterface $storage, AccountInterface $user, ViewsData $views_data, RouteProviderInterface $route_provider, Token $token_utility) { // Reference the storage and the executable to each other. $this->storage = $storage; $this->storage->set('executable', $this); $this->user = $user; $this->viewsData = $views_data; + $this->routeProvider = $route_provider; $this->tokenUtility = $token_utility; // Add the default css for a view. diff --git a/core/modules/views/src/ViewExecutableFactory.php b/core/modules/views/src/ViewExecutableFactory.php index e2b5212..52e527c 100644 --- a/core/modules/views/src/ViewExecutableFactory.php +++ b/core/modules/views/src/ViewExecutableFactory.php @@ -55,13 +55,16 @@ class ViewExecutableFactory { * The request stack. * @param \Drupal\views\ViewsData $views_data * The views data. + * @param \Drupal\Core\Routing\RouteProviderInterface $route_provider + * The route provider. * @param \Drupal\Core\Utility\Token $token_utility * The token utility. */ - public function __construct(AccountInterface $user, RequestStack $request_stack, ViewsData $views_data, Token $token_utility) { + public function __construct(AccountInterface $user, RequestStack $request_stack, ViewsData $views_data, RouteProviderInterface $route_provider, Token $token_utility) { $this->user = $user; $this->requestStack = $request_stack; $this->viewsData = $views_data; + $this->routeProvider = $route_provider; $this->tokenUtility = $token_utility; } diff --git a/core/modules/views/tests/src/Unit/Plugin/area/ResultTest.php b/core/modules/views/tests/src/Unit/Plugin/area/ResultTest.php index 53acc30..4a89a3f 100644 --- a/core/modules/views/tests/src/Unit/Plugin/area/ResultTest.php +++ b/core/modules/views/tests/src/Unit/Plugin/area/ResultTest.php @@ -46,10 +46,11 @@ protected function setUp() { $views_data = $this->getMockBuilder('Drupal\views\ViewsData') ->disableOriginalConstructor() ->getMock(); + $route_provider = $this->getMock('Drupal\Core\Routing\RouteProviderInterface'); $token_utility = $this->getMockBuilder('Drupal\Core\Utility\Token') ->disableOriginalConstructor() ->getMock(); - $this->view = new ViewExecutable($storage, $user, $views_data, $token_utility); + $this->view = new ViewExecutable($storage, $user, $views_data, $route_provider, $token_utility); $this->resultHandler = new Result(array(), 'result', array()); $this->resultHandler->view = $this->view; diff --git a/core/modules/views/tests/src/Unit/Plugin/field/CounterTest.php b/core/modules/views/tests/src/Unit/Plugin/field/CounterTest.php index bb611b1..b3b0ddd 100644 --- a/core/modules/views/tests/src/Unit/Plugin/field/CounterTest.php +++ b/core/modules/views/tests/src/Unit/Plugin/field/CounterTest.php @@ -75,10 +75,11 @@ protected function setUp() { $views_data = $this->getMockBuilder('Drupal\views\ViewsData') ->disableOriginalConstructor() ->getMock(); + $route_provider = $this->getMock('Drupal\Core\Routing\RouteProviderInterface'); $token_utility = $this->getMockBuilder('Drupal\Core\Utility\Token') ->disableOriginalConstructor() ->getMock(); - $this->view = $this->getMock('Drupal\views\ViewExecutable', NULL, array($storage, $user, $views_data, $token_utility)); + $this->view = $this->getMock('Drupal\views\ViewExecutable', NULL, array($storage, $user, $views_data, $route_provider, $token_utility)); $this->display = $this->getMockBuilder('Drupal\views\Plugin\views\display\DisplayPluginBase') ->disableOriginalConstructor() diff --git a/core/modules/views/tests/src/Unit/ViewsTest.php b/core/modules/views/tests/src/Unit/ViewsTest.php index a5c170d..f520418 100644 --- a/core/modules/views/tests/src/Unit/ViewsTest.php +++ b/core/modules/views/tests/src/Unit/ViewsTest.php @@ -34,10 +34,11 @@ protected function setUp() { $views_data = $this->getMockBuilder('Drupal\views\ViewsData') ->disableOriginalConstructor() ->getMock(); + $route_provider = $this->getMock('Drupal\Core\Routing\RouteProviderInterface'); $token_utility = $this->getMockBuilder('Drupal\Core\Utility\Token') ->disableOriginalConstructor() ->getMock(); - $container->set('views.executable', new ViewExecutableFactory($user, $request_stack, $views_data, $token_utility)); + $container->set('views.executable', new ViewExecutableFactory($user, $request_stack, $views_data, $route_provider, $token_utility)); $this->view = new View(array('id' => 'test_view'), 'view'); diff --git a/core/modules/views/views.services.yml b/core/modules/views/views.services.yml index af7402f..29f776a 100644 --- a/core/modules/views/views.services.yml +++ b/core/modules/views/views.services.yml @@ -64,7 +64,7 @@ services: arguments: ['@views.views_data'] views.executable: class: Drupal\views\ViewExecutableFactory - arguments: ['@current_user', '@request_stack', '@views.views_data', '@token'] + arguments: ['@current_user', '@request_stack', '@views.views_data', '@router.route_provider', '@token'] views.analyzer: class: Drupal\views\Analyzer arguments: ['@module_handler'] diff --git a/core/modules/views_ui/tests/src/Unit/ViewListBuilderTest.php b/core/modules/views_ui/tests/src/Unit/ViewListBuilderTest.php index b244f48..68f78dc 100644 --- a/core/modules/views_ui/tests/src/Unit/ViewListBuilderTest.php +++ b/core/modules/views_ui/tests/src/Unit/ViewListBuilderTest.php @@ -125,10 +125,11 @@ public function testBuildRowEntityList() { $views_data = $this->getMockBuilder('Drupal\views\ViewsData') ->disableOriginalConstructor() ->getMock(); + $route_provider = $this->getMock('Drupal\Core\Routing\RouteProviderInterface'); $token = $this->getMockBuilder('Drupal\Core\Utility\Token') ->disableOriginalConstructor() ->getMock(); - $executable_factory = new ViewExecutableFactory($user, $request_stack, $views_data, $token); + $executable_factory = new ViewExecutableFactory($user, $request_stack, $views_data, $route_provider, $token); $container->set('views.executable', $executable_factory); $container->set('plugin.manager.views.display', $display_manager); \Drupal::setContainer($container);