diff --git a/core/modules/views/src/Plugin/views/filter/Date.php b/core/modules/views/src/Plugin/views/filter/Date.php index 6e7f1f2..7e5417f 100644 --- a/core/modules/views/src/Plugin/views/filter/Date.php +++ b/core/modules/views/src/Plugin/views/filter/Date.php @@ -42,13 +42,6 @@ protected function valueForm(&$form, FormStateInterface $form_state) { '#default_value' => !empty($this->value['type']) ? $this->value['type'] : 'date', ); } - else { - // Ensure there is something in the 'type'. - $form['value']['type'] = array( - '#type' => 'value', - '#value' => NULL - ); - } parent::valueForm($form, $form_state); } diff --git a/core/modules/views/src/Plugin/views/filter/Numeric.php b/core/modules/views/src/Plugin/views/filter/Numeric.php index ef4fb1d..38c0fca 100644 --- a/core/modules/views/src/Plugin/views/filter/Numeric.php +++ b/core/modules/views/src/Plugin/views/filter/Numeric.php @@ -184,7 +184,9 @@ protected function valueForm(&$form, FormStateInterface $form_state) { } } elseif ($which == 'value') { - $form['value']['value'] = array( + // When exposed we drop the value-value and just do value if + // the operator is locked. + $form['value'] = array( '#type' => 'textfield', '#title' => !$exposed ? $this->t('Value') : '', '#size' => 30, @@ -229,7 +231,7 @@ protected function valueForm(&$form, FormStateInterface $form_state) { if (!isset($form['value'])) { // Ensure there is something in the 'value'. - $form['value']['value'] = array( + $form['value'] = array( '#type' => 'value', '#value' => NULL ); diff --git a/core/modules/views_ui/src/Tests/PreviewTest.php b/core/modules/views_ui/src/Tests/PreviewTest.php index 22ca5b2..191e4b4 100644 --- a/core/modules/views_ui/src/Tests/PreviewTest.php +++ b/core/modules/views_ui/src/Tests/PreviewTest.php @@ -40,7 +40,7 @@ protected function testPreviewContextual() { $this->drupalPostForm(NULL, $edit = array('view_args' => '100'), t('Update preview')); // Test that area text and exposed filters are present and rendered. - $this->assertFieldByName('id[value]', NULL, 'ID exposed filter field found.'); + $this->assertFieldByName('id', NULL, 'ID exposed filter field found.'); $this->assertText('Test header text', 'Rendered header text found'); $this->assertText('Test footer text', 'Rendered footer text found.'); $this->assertText('Test empty text', 'Rendered empty text found.'); @@ -71,7 +71,7 @@ function testPreviewUI() { $this->assertEqual(count($elements), 0); // Test that area text and exposed filters are present and rendered. - $this->assertFieldByName('id[value]', NULL, 'ID exposed filter field found.'); + $this->assertFieldByName('id', NULL, 'ID exposed filter field found.'); $this->assertText('Test header text', 'Rendered header text found'); $this->assertText('Test footer text', 'Rendered footer text found.'); $this->assertText('Test empty text', 'Rendered empty text found.');