Skip to content

Drupal Group Module

I need to... Guide Summary
Understand how Group 4.x is structured Core Architecture Group 4.x uses the same data model as 3.x (group_relationship, scopes, GroupRelationBase) but drops all contrib dependencies — permission calculation moved to Drupal core's Access Policy API and all hooks became OOP classes.
Know which entity types Group provides Entity Types Reference this when you need to know the exact entity type IDs, base tables, bundle systems, and key fields of every entity Group provides. In 4.x the $roles filter on loadByGroup() and loadByUser() must be an array.
Create a custom relation type plugin Plugin System Read this when creating a custom group relation type plugin to allow a new entity type (or bundle) to be added to groups.
Understand how permissions work Permissions System Group 4.x calculates permissions via Drupal core's Access Policy API (IndividualGroupRoleAccessPolicy + SynchronizedGroupRoleAccessPolicy); custom calculators must be re-implemented as AccessPolicyBase subclasses tagged access_policy.
Control access to grouped content Access Control Read this when diagnosing access issues, understanding the "explicit forbid" pattern, or writing custom access control for group-related entities. In 4.x the entity_access hook is implemented as EntityHooks::entityAccess() (OOP), not group_entity_access() (procedural).
Write YAML config for group types / roles Configuration Reference this when writing or exporting configuration YAML for group types, group roles, relationship types, or plugin config. In 4.x, creator_wizard and use_creation_wizard are removed — drop them from any migrated config.
Use the Group PHP API programmatically PHP API Reference this when writing PHP code to create groups, add members, relate content, or query group data programmatically. In 4.x: group.membership_loader is removed, $roles filter must be an array, and creator membership is form-only.
Build Views with Group data Views Integration Reference this when building Views that display groups, group members, or content within groups.
Hook into Group with custom code Hooks and Events Reference this when looking for extension points to react to Group events without altering core Group logic. In 4.x Group has no .module file — all hooks are OOP methods in src/Hook/; do not call group_entity_access() or other procedural Group functions.
Add nodes to groups (gnode sub-module) Sub-modules Reference this when enabling node support, revision support for grouped entities, or looking at how official sub-modules structure their plugins.
Automate group operations with VBO or ECA Group Actions (contrib) Automates group operations via VBO/ECA — but drupal/group_action 1.2.2 caps at Group ^3@beta and excludes 4.x entirely. On Group 4.0.x, write the actions yourself against the PHP API instead.
Understand how caching works Caching Read this when debugging stale cached output for group-aware content, or when optimizing the performance of group membership and permission lookups.
Compare Group vs Domain vs Permissions by Term When to Use Group Read this before starting a project to choose the right access control approach. Picking the wrong module early is expensive to change.
Migrate from v1/v2 to v3, or v3 to v4 Migration from v1/v2 Read this if you are moving an existing Group site to a newer major version. v1→v2 is an in-place update once the site has run updates through 8023; v2→v3 requires a full data migration (group2to3 is Unsupported/Obsolete — don't use it); v3→v4 requires an explicit @alpha stability flag since 4.0.x has no stable tag.
Avoid common mistakes Common Mistakes Review this before shipping group-related code to catch frequent errors.
Review security considerations Security Review this before deploying a Group-based site to production to understand the trust model and potential vulnerabilities. Anonymous is not its own scope — it is an outsider-scope role with global_role: anonymous.