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

Command icon 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

mably created an issue. See original summary.

  • mably committed 3668f79b on 3.x
    feat: #3579135 Add generic DomainFilter Views plugin for domain entity...
mably’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.