Loading core/modules/views/src/Plugin/views/filter/FilterPluginBase.php +1 −1 Original line number Diff line number Diff line Loading @@ -1165,7 +1165,7 @@ protected function buildExposedFiltersGroupForm(&$form, FormStateInterface $form } } if (!empty($this->options['group_info']['group_items'][$item_id]['value'][$child])) { if (isset($this->options['group_info']['group_items'][$item_id]['value'][$child])) { $row['value'][$child]['#default_value'] = $this->options['group_info']['group_items'][$item_id]['value'][$child]; } } Loading core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/GroupedExposedFilterTest.php +17 −0 Original line number Diff line number Diff line Loading @@ -111,6 +111,23 @@ public function testGroupedFilterValuesUI() { $this->assertNotEmpty($weight->find('named', ['option', $value])); } $this->assertEmpty($weight->find('named', ['option', 5])); // Set the date value to a zero value and make sure it's stored. $between_from = $page->findField('options[group_info][group_items][1][value][min]'); $between_from->setValue('0'); $apply_button = $page->find('css', '.views-ui-dialog button.button--primary'); $this->assertNotEmpty($apply_button); $apply_button->press(); $web_assert->assertWaitOnAjaxRequest(); // Open the dialog for the grouped filter. $page->clickLink('Content: Authored on (grouped)'); $web_assert->assertWaitOnAjaxRequest(); // Test that the 'min' field is shown and that it contains the right value. $between_from = $page->findField('options[group_info][group_items][1][value][min]'); $this->assertNotEmpty($between_from->isVisible()); $this->assertEquals('0', $between_from->getValue()); } } Loading
core/modules/views/src/Plugin/views/filter/FilterPluginBase.php +1 −1 Original line number Diff line number Diff line Loading @@ -1165,7 +1165,7 @@ protected function buildExposedFiltersGroupForm(&$form, FormStateInterface $form } } if (!empty($this->options['group_info']['group_items'][$item_id]['value'][$child])) { if (isset($this->options['group_info']['group_items'][$item_id]['value'][$child])) { $row['value'][$child]['#default_value'] = $this->options['group_info']['group_items'][$item_id]['value'][$child]; } } Loading
core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/GroupedExposedFilterTest.php +17 −0 Original line number Diff line number Diff line Loading @@ -111,6 +111,23 @@ public function testGroupedFilterValuesUI() { $this->assertNotEmpty($weight->find('named', ['option', $value])); } $this->assertEmpty($weight->find('named', ['option', 5])); // Set the date value to a zero value and make sure it's stored. $between_from = $page->findField('options[group_info][group_items][1][value][min]'); $between_from->setValue('0'); $apply_button = $page->find('css', '.views-ui-dialog button.button--primary'); $this->assertNotEmpty($apply_button); $apply_button->press(); $web_assert->assertWaitOnAjaxRequest(); // Open the dialog for the grouped filter. $page->clickLink('Content: Authored on (grouped)'); $web_assert->assertWaitOnAjaxRequest(); // Test that the 'min' field is shown and that it contains the right value. $between_from = $page->findField('options[group_info][group_items][1][value][min]'); $this->assertNotEmpty($between_from->isVisible()); $this->assertEquals('0', $between_from->getValue()); } }