gnode.tokens.inc still has Group 1.x classes

Created on 27 February 2024, about 1 year ago
Updated 29 March 2024, about 1 year ago

An error appeared in my site recently:

Error: Class "GroupContent" not found in gnode_tokens() (line 63 of ###/web/modules/contrib/group/modules/gnode/gnode.tokens.inc).

I found the helpful resource: https://www.drupal.org/docs/extending-drupal/contributed-modules/contrib... β†’

Looking in the code for the gnode.tokens.inc file...

I changed line 9 from:
use Drupal\group\Entity\GroupContent;
to:
use Drupal\group\Entity\GroupRelationship;

And I updated line 63 from:
$group_content_array = GroupContent::loadByEntity($data['node']);
to
$group_content_array = GroupRelationship::loadByEntity($data['node']);

That solved the issue it had been creating in my site.

Sorry, I'm not really a Drupal developer. I'm not sure if that truly fixes everything (maybe there are other issues in that file?) or how to generate a patch for what I did do. I'm posting this to hopefully help out. If someone more knowledgeable sees that it's legit, then please take over the appropriate steps from here... Thanks!

πŸ’¬ Support request
Status

Closed: duplicate

Version

2.2

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States bkloef

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

Comments & Activities

Production build 0.71.5 2024