When other modules add entity_reference fields targeting domain entities (e.g. a domain_id field on redirects or other content), there is no reusable Views filter plugin to expose a select list of domains.
Currently, such fields default to a plain string filter in Views, which is not user-friendly. Each module that adds a domain reference field has to implement its own filter plugin.
This patch adds a generic DomainFilter Views filter plugin (domain_filter) to the domain module. It extends InOperator and uses DomainStorage::loadOptionsList() to populate a select list of available domains.
Other modules can then use hook_views_data_alter() to set 'filter' => ['id' => 'domain_filter'] on their domain reference fields, getting a proper dropdown filter without duplicating code.
Issue fork domain-3579135
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
mably commented