Add views contextual filter to get group ID from URL or group content 2.x

Created on 10 July 2023, 12 months ago

Re-post of #3112501 Add views contextual filter to get group ID from either URL or group content β†’ to update for Group 2.x branch.

I have a site that relies on the original 1.x patch that needs to be upgraded to Group 2.x. This issue provides a patch for the 2.x version of Group. While there is a separate issue to add contexts ( #2815971 More contexts needed πŸ“Œ More contexts needed Needs work ), this patch allows Group 1.x users relying on the patch in #3112501 to upgrade without any additional configuration changes.

I'm posting this as a new issue since the old one was closed prematurely, without being committed to an official release, and I want to make sure this gets seen. There was a request to re-open #3112501 in the comments, but that appears to have been overlooked. I'd be happy to have this issue merged in with #3112501 if it were to be re-opened.

✨ Feature request
Status

Active

Version

2.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States DaleTrexel Minnesota, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @DaleTrexel
  • πŸ‡ΊπŸ‡ΈUnited States DaleTrexel Minnesota, USA

    Adding patch.

    The only change needed (as far as I can tell), is to replace
    \Drupal\group\Entity\GroupContent::loadByEntity($entity)
    with
    \Drupal\group\Entity\GroupRelationship::loadByEntity($entity)

Production build 0.69.0 2024