Add views relationship to group entities from og_membership entities

Created on 17 May 2025, about 5 hours ago

Problem/Motivation

OgMembershipViewsData exposed a relationship to users via
uid but never offered a relationship from entity_id back to
the group entities themselves. This meant Views could not join an OG membership to its
parent group (node, taxonomy term, etc.), so group-level fields were unavailable.

Proposed resolution

  • Register one relationship per enabled OG group entity type by looping through
    GroupTypeManager::getGroupMap().
  • Each relationship joins og_membership.entity_id to the primary key of the
    group entity’s data table and is limited with
    extra => entity_type = <type_id>.
  • Expose an optional filter on entity_bundle so view builders can restrict
    results to specific bundles when needed.
Feature request
Status

Needs work

Version

1.0

Component

og.module

Created by

🇨🇦Canada joelpittet Vancouver

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024