diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/display/PathPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/display/PathPluginBase.php index 7a81052..0980ac8 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/display/PathPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/display/PathPluginBase.php @@ -7,6 +7,7 @@ namespace Drupal\views\Plugin\views\display; +use Drupal; use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\Routing\Route; @@ -82,7 +83,7 @@ public function collectRoutes(RouteCollection $collection) { $access_plugin = $this->getPlugin('access'); if (!isset($access_plugin)) { // @todo Do we want to support a default plugin in getPlugin itself? - $access_plugin = drupal_container()->get('plugin.manager.views.access')->createInstance('none'); + $access_plugin = Drupal::service('plugin.manager.views.access')->createInstance('none'); } $access_plugin->alterRouteDefinition($route); @@ -119,13 +120,8 @@ public function executeHookMenu($callbacks) { if ($path) { $items[$path] = array( // Default views page entry. - // @todo _menu_router_build() denies access to paths without a page - // callback. - 'page callback' => 'NOT_USED', - 'page arguments' => array(), - // Default access check (per display). - 'access callback' => TRUE, - // Identify URL embedded arguments and correlate them to a handler. + // Identify URL embedded arguments and correlate them to a + // handler. 'load arguments' => array($this->view->storage->id(), $this->display['id'], '%index'), ); $menu = $this->getOption('menu'); @@ -183,11 +179,6 @@ public function executeHookMenu($callbacks) { // Default views page entry. // @todo _menu_router_build() denies access to paths without a page // callback. - 'page callback' => 'NOT_USED', - 'page arguments' => array(), - // Default access check (per display). - 'access callback' => 'views_access', - 'access arguments' => $access_arguments, // Identify URL embedded arguments and correlate them to a // handler. 'load arguments' => array($this->view->storage->id(), $this->display['id'], '%index'), diff --git a/core/modules/views/lib/Drupal/views/ViewsAccessCheck.php b/core/modules/views/lib/Drupal/views/ViewsAccessCheck.php index b4c7739..b5242bf 100644 --- a/core/modules/views/lib/Drupal/views/ViewsAccessCheck.php +++ b/core/modules/views/lib/Drupal/views/ViewsAccessCheck.php @@ -22,7 +22,7 @@ class ViewsAccessCheck implements AccessCheckInterface { * Implements AccessCheckInterface::applies(). */ public function applies(Route $route) { - return $route->getRequirement('_access_all_views'); + return array_key_exists('view_id', $route->getDefaults()); } /**