diff --git a/core/modules/views/src/Plugin/views/display/PathPluginBase.php b/core/modules/views/src/Plugin/views/display/PathPluginBase.php index 402e00c..a62e2c2 100644 --- a/core/modules/views/src/Plugin/views/display/PathPluginBase.php +++ b/core/modules/views/src/Plugin/views/display/PathPluginBase.php @@ -134,7 +134,7 @@ protected function defineOptions() { protected function getRoute($view_id, $display_id) { $defaults = array( '_controller' => 'Drupal\views\Routing\ViewPageController::handle', - '_title' => $this->view->getTitle(), + '_title' => $this->getOption('title'), 'view_id' => $view_id, 'display_id' => $display_id, '_view_display_show_admin_links' => $this->getOption('show_admin_links'), diff --git a/core/modules/views/tests/src/Unit/Plugin/display/PathPluginBaseTest.php b/core/modules/views/tests/src/Unit/Plugin/display/PathPluginBaseTest.php index 90d2ae7..094edf8 100644 --- a/core/modules/views/tests/src/Unit/Plugin/display/PathPluginBaseTest.php +++ b/core/modules/views/tests/src/Unit/Plugin/display/PathPluginBaseTest.php @@ -96,6 +96,7 @@ public function testCollectRoutes() { $display['id'] = 'page_1'; $display['display_options'] = array( 'path' => 'test_route', + 'title' => 'my views title', ); $this->pathPlugin->initDisplay($view, $display); @@ -124,6 +125,7 @@ public function testCollectRoutesWithDisplayReturnResponse() { $display['id'] = 'page_1'; $display['display_options'] = array( 'path' => 'test_route', + 'title' => 'my views title', ); $this->pathPlugin = $this->getMockBuilder('Drupal\views\Plugin\views\display\PathPluginBase') ->setConstructorArgs(array(array(), 'path_base', array('returns_response' => TRUE), $this->routeProvider, $this->state)) @@ -151,6 +153,7 @@ public function testCollectRoutesWithArguments() { $display['id'] = 'page_1'; $display['display_options'] = array( 'path' => 'test_route/%/example', + 'title' => 'my views title', ); $this->pathPlugin->initDisplay($view, $display); @@ -179,6 +182,7 @@ public function testCollectRoutesWithArgumentsNotSpecifiedInPath() { $display['id'] = 'page_1'; $display['display_options'] = array( 'path' => 'test_with_arguments', + 'title' => 'my views title', ); $display['display_options']['arguments'] = array( 'test_id' => array(), @@ -209,6 +213,7 @@ public function testCollectRoutesWithSpecialRouteName() { $display['display_options'] = array( 'path' => 'test_route', 'route_name' => 'test_route', + 'title' => 'my views title', ); $this->pathPlugin->initDisplay($view, $display); @@ -239,6 +244,7 @@ public function testAlterRoute() { $display['id'] = 'page_1'; $display['display_options'] = array( 'path' => 'test_route', + 'title' => 'my views title', ); $this->pathPlugin->initDisplay($view, $display); @@ -276,6 +282,7 @@ public function testAlterRouteWithAlterCallback() { $display['id'] = 'page_1'; $display['display_options'] = array( 'path' => 'test_route', + 'title' => 'my views title', ); $this->pathPlugin->initDisplay($view, $display); @@ -317,6 +324,7 @@ public function testCollectRoutesWithNamedParameters() { $display['id'] = 'page_1'; $display['display_options'] = array( 'path' => 'test_route/%node/example', + 'title' => 'my views title', ); $this->pathPlugin->initDisplay($view, $display); @@ -353,6 +361,7 @@ public function testAlterRoutesWithParameters() { $display['id'] = 'page_1'; $display['display_options'] = array( 'path' => 'test_route/%', + 'title' => 'my views title', ); $this->pathPlugin->initDisplay($view, $display); @@ -390,6 +399,7 @@ public function testAlterRoutesWithParametersAndUpcasting() { $display['id'] = 'page_1'; $display['display_options'] = [ 'path' => 'test_route/%', + 'title' => 'my views title', ]; $this->pathPlugin->initDisplay($view, $display); @@ -422,6 +432,7 @@ public function testAlterRoutesWithOptionalParameters() { $display['id'] = 'page_1'; $display['display_options'] = array( 'path' => 'test_route/%', + 'title' => 'my views title', ); $display['display_options']['arguments'] = array( 'test_id' => array(), @@ -454,6 +465,7 @@ public function testGetRouteName() { $display['id'] = 'page_1'; $display['display_options'] = array( 'path' => 'test_route', + 'title' => 'my views title', ); $this->pathPlugin->initDisplay($view, $display); $route_name = $this->pathPlugin->getRouteName(); @@ -475,9 +487,6 @@ protected function setupViewExecutableAccessPlugin() { $view = $this->getMockBuilder('Drupal\views\ViewExecutable') ->disableOriginalConstructor() ->getMock(); - $view->expects($this->any()) - ->method('getTitle') - ->willReturn('my views title'); $view->storage = $view_entity;