Drupal Version

10.3.2

Domain module version

2.0.x-dev

Expected Behavior

A user installs a module with an entity and needs to add the Available on Current Domain filter to a view for an entity type that is installed with that module. If I add field_domain_access and field_domain_all_affiliates, I want to use the Available on Current Domain filter.

Actual Behavior

Available on Current Domain filter is hard-coded to be only available for `node` entities.

Steps to reproduce

1. Enable a module: group, media, etc
2. Create a view for group or media
3. Try to add Available on Current Domain filter
4. Not available in filter list

Steps to resolve

1. In domain_access.module, in hook method domain_access_views_data_alter(), iterate entity types via entity type manager interface and add the Available on Current Domain for all available entity types.
2. In DomainAccessCurrentAllFilter.php, alter the query() method to check if the `table` is `field_domain_access`, and `explode` on `__` to get the base entity type and replace the hard-coded `node` value.

Issue fork domain-3476063

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’s picture

Status: Active » Needs work

A rebase is needed. Thanks.

mably’s picture

Rebase done with a few fixes.

mably’s picture

Status: Needs work » Needs review

Could we have some RTBC before merging please?

mably’s picture

mably’s picture

Status: Needs review » Fixed
Issue tags: -next-release

Status: Fixed » Closed (fixed)

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