Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Group Entity Reference Filter

Security covered Under active development 6 sites

Part of the Group ecosystem · 61 projects

This module restricts entity reference fields to show only content within the same group as the entity being edited. This ensures that related content, like tasks or reports, are correctly linked to their associated group. It works with various field widgets and handles different scenarios, including when content is not yet in a group.

Group Entity Reference Filter narrows an entity reference field to the content of the group you are working in, so a task can only be assigned to a list in its own group and a report can only point at its own client's data.

It does this with a selection handler rather than a widget, so it applies to the field itself. Autocomplete, select lists, checkboxes and the validation that runs when the form is submitted all go through the same handler and all see the same restricted set.

What gets offered

  • When the entity being edited is in a group, the entities of the target type in that group. If it is in several groups, the entities in any of them.
  • When the entity is itself a group, that group's content.
  • When content is created from a group route and does not exist yet, the content of the group in the route.
  • A field pointing at users comes out as the members of the group, because a membership is a group relation like any other. That is what makes an "Assigned to" field list the people who are actually in the group.
  • When the group holds nothing of the target type, nothing. The field is empty rather than full: offering the whole site at the one moment the group turns out to be empty is the opposite of what the field was configured to do, and on a site with more than one group it is how one group's content ends up referenced from another's.
  • When the entity is in no group at all, everything, exactly like the default handler. There is nothing to narrow down to, so the field stays usable on content that simply does not live in a group.

The group of the person filling the form is never consulted. Two editors in different groups editing the same content see the same options.

Requirements

  • Drupal 10.3 or newer. The handler is declared with a PHP attribute, and core only discovers those for selection plugins from 10.3 onwards. On 10.0 to 10.2 the reference method does not appear at all.
  • Group 3.x.

Usage

On any entity reference field, open Manage fields, edit the field, and set Reference method to Group membership filter. The remaining settings are the ones from the default handler: bundles, sorting and auto-create. Nothing else has to be configured.

Known limitation

Creating content from a group route with an autocomplete widget cannot be filtered. The host entity does not exist yet, so core has no ID to put in the autocomplete request, and that request carries no group of its own. Use a select or checkboxes widget on those forms, or create the content and edit it afterwards. Every other combination is filtered, autocomplete included. This is tracked in the issue queue.

Drupal 10–11

Ask your assistant about Group Entity Reference Filter

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

  • Group
  • field Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
3
Tracked since
Jan 2025
Latest release
4 days ago
Releases (12 mo)
2 ▲ from 1
Maintenance
Active

Release Timeline

Releases

Version Type Core PHP Release date
1.0.1 Stable 10–11 Oct 7, 2026
1.0.0 Stable 10–11 Aug 29, 2026
1.0.x-dev Dev 10–11 Jan 5, 2025