diff --git a/core/modules/views/src/Tests/ViewExecutableTest.php b/core/modules/views/src/Tests/ViewExecutableTest.php index 6ecca04..d4cbce8 100644 --- a/core/modules/views/src/Tests/ViewExecutableTest.php +++ b/core/modules/views/src/Tests/ViewExecutableTest.php @@ -20,6 +20,7 @@ use Drupal\views\Plugin\views\pager\PagerPluginBase; use Drupal\views\Plugin\views\query\QueryPluginBase; use Drupal\views_test_data\Plugin\views\display\DisplayTest; +use Symfony\Component\DependencyInjection\Container; use Symfony\Component\HttpFoundation\Response; /** @@ -70,7 +71,6 @@ class ViewExecutableTest extends ViewUnitTestBase { 'attachment_before', 'attachment_after', 'exposed_data', - 'exposed_input', 'exposed_raw_input', 'old_view', 'parent_views', @@ -186,6 +186,9 @@ public function testProperties() { foreach ($this->executableProperties as $property) { $this->assertTrue(isset($view->{$property})); } + + // Per default exposed input should fall back to an empty array. + $this->assertEqual($view->getExposedInput(), []); } /** diff --git a/core/modules/views/src/ViewExecutable.php b/core/modules/views/src/ViewExecutable.php index 8441fa4..2cc6c01 100644 --- a/core/modules/views/src/ViewExecutable.php +++ b/core/modules/views/src/ViewExecutable.php @@ -568,6 +568,9 @@ public function getExposedInput() { // Fill our input either from \Drupal::request()->query or from something // previously set on the view. if (empty($this->exposed_input)) { + // Ensure that we can call the method at any point in time. + $this->initDisplay(); + $this->exposed_input = \Drupal::request()->query->all(); // unset items that are definitely not our input: foreach (array('page', 'q') as $key) {