diff --git a/core/modules/views/src/ViewExecutable.php b/core/modules/views/src/ViewExecutable.php index 5712309..b662ab7 100644 --- a/core/modules/views/src/ViewExecutable.php +++ b/core/modules/views/src/ViewExecutable.php @@ -1770,11 +1770,9 @@ public function hasUrl($args = NULL, $display_id = NULL) { return TRUE; } - if (!empty($this->live_preview)) { - return FALSE; - } - - if (!empty($this->changed)) { + // If the views is being executed as a live preview or the view has been + // marked as being changed, the route for the display may not exist yet. + if (!empty($this->live_preview) || !empty($this->changed)) { return FALSE; } diff --git a/core/modules/views_ui/src/Tests/UITestBase.php b/core/modules/views_ui/src/Tests/UITestBase.php index 0638114..f8cef54 100644 --- a/core/modules/views_ui/src/Tests/UITestBase.php +++ b/core/modules/views_ui/src/Tests/UITestBase.php @@ -35,18 +35,10 @@ */ public static $modules = array('node', 'views_ui', 'block', 'taxonomy'); - /** - * Sets up a Drupal site for running functional and integration tests. - * - * @param boolean $enable_views_test_module - * Whether views_test_data.module should be enabled or not. - */ - protected function setUp($enable_views_test_module = TRUE) { + protected function setUp() { parent::setUp(); - if ($enable_views_test_module) { - $this->enableViewsTestModule(); - } + $this->enableViewsTestModule(); $this->adminUser = $this->drupalCreateUser(array('administer views')); diff --git a/core/modules/views_ui/src/Tests/UnsavedPreviewTest.php b/core/modules/views_ui/src/Tests/UnsavedPreviewTest.php index 78e940b..253cb92 100644 --- a/core/modules/views_ui/src/Tests/UnsavedPreviewTest.php +++ b/core/modules/views_ui/src/Tests/UnsavedPreviewTest.php @@ -7,12 +7,14 @@ namespace Drupal\views_ui\Tests; +use Drupal\views\Tests\ViewTestBase; + /** * Tests covering Preview uf unsaved Views. * * @group views_ui */ -class UnsavedPreviewTest extends UITestBase { +class UnsavedPreviewTest extends ViewTestBase { /** * Views used by this test. @@ -22,10 +24,25 @@ class UnsavedPreviewTest extends UITestBase { public static $testViews = ['content']; /** + * An admin user with the 'administer views' permission. + * + * @var \Drupal\user\UserInterface + */ + protected $adminUser; + + /** + * {@inheritdoc} + */ + public static $modules = array('node', 'views_ui'); + + /** * Sets up a Drupal site for running functional and integration tests. */ protected function setUp() { parent::setUp(FALSE); + + $this->adminUser = $this->drupalCreateUser(['administer views']); + $this->drupalLogin($this->adminUser); } /**