diff --git a/core/modules/views/src/Plugin/views/display/PathPluginBase.php b/core/modules/views/src/Plugin/views/display/PathPluginBase.php index eb5b204..f3d90ce 100644 --- a/core/modules/views/src/Plugin/views/display/PathPluginBase.php +++ b/core/modules/views/src/Plugin/views/display/PathPluginBase.php @@ -9,6 +9,7 @@ use Drupal\Core\Access\AccessManagerInterface; use Drupal\Core\Form\FormStateInterface; +use Drupal\Core\Routing\UrlGeneratorTrait; use Drupal\Core\State\StateInterface; use Drupal\Core\Routing\RouteCompiler; use Drupal\Core\Routing\RouteProviderInterface; @@ -27,6 +28,8 @@ */ abstract class PathPluginBase extends DisplayPluginBase implements DisplayRouterInterface { + use UrlGeneratorTrait; + /** * The route provider. * diff --git a/core/modules/views/src/Tests/ViewUnitTestBase.php b/core/modules/views/src/Tests/ViewUnitTestBase.php index fa14ec9..ad5c392 100644 --- a/core/modules/views/src/Tests/ViewUnitTestBase.php +++ b/core/modules/views/src/Tests/ViewUnitTestBase.php @@ -55,6 +55,7 @@ protected function setUpFixtures() { // The router table is required for router rebuilds. $this->installSchema('system', array('router')); + \Drupal::service('router.builder')->rebuild(); // Load the test dataset. $data_set = $this->dataSet();