only in patch2: unchanged: --- a/core/modules/options/config/schema/options.schema.yml +++ b/core/modules/options/config/schema/options.schema.yml @@ -155,3 +155,9 @@ views.argument.string_list_field: views.filter.list_field: type: views.filter.many_to_one + +views.filter.group_item.list_field: + type: views_filter_group_item + mapping: + value: + type: mapping \ No newline at end of file only in patch2: unchanged: --- a/core/modules/options/tests/src/Kernel/Views/OptionsListFilterTest.php +++ b/core/modules/options/tests/src/Kernel/Views/OptionsListFilterTest.php @@ -35,4 +35,78 @@ public function testViewsTestOptionsListFilter() { $this->assertIdenticalResultset($view, $resultset, $column_map); } + /** + * Tests options list field filter when grouped. + */ + public function testViewsTestOptionsListGroupedFilter() { + $view = Views::getView('test_options_list_filter'); + + $filters = [ + 'field_test_list_string_value' => [ + 'id' => 'field_test_list_string_value', + 'table' => 'field_data_field_test_list_string', + 'field' => 'field_test_list_string_value', + 'relationship' => 'none', + 'group_type' => 'group', + 'admin_label' => '', + 'operator' => 'or', + 'value' => [ + 'man' => 'man', + 'woman' => 'woman', + ], + 'group' => '1', + 'exposed' => TRUE, + 'expose' => [ + 'operator_id' => 'field_test_list_string_value_op', + 'label' => 'list-text', + 'description' => '', + 'identifier' => 'field_test_list_string_value', + ], + 'is_grouped' => TRUE, + 'group_info' => [ + 'label' => 'list-text (field_list_text)', + 'description' => '', + 'identifier' => 'field_test_list_string_value', + 'optional' => TRUE, + 'widget' => 'radios', + 'multiple' => TRUE, + 'remember' => FALSE, + 'default_group' => '1', + 'group_items' => [ + 1 => [ + 'title' => 'Man', + 'operator' => 'or', + 'value' => [ + 'man' => 'man', + ] + ], + 2 => [ + 'title' => 'Woman', + 'operator' => 'or', + 'value' => [ + 'woman' => 'woman', + ] + ], + ], + ], + 'reduce_duplicates' => '', + 'plugin_id' => 'list_field', + ] + ]; + $view->setDisplay(); + $view->displayHandlers->get('default')->overrideOption('filters', $filters); + + $view->storage->save(); + + $this->executeView($view); + + $resultset = [ + ['nid' => $this->nodes[0]->nid->value], + ['nid' => $this->nodes[1]->nid->value], + ]; + + $column_map = ['nid' => 'nid']; + $this->assertIdenticalResultset($view, $resultset, $column_map); + } + }