Can't see group roles when editing member relationship entities following upgrade from v1

Created on 24 June 2024, 7 months ago

The following info overlaps with info I just submitted in this other issue ✨ 2.3.x branch: Update version of flexible_permissions required to version 2.0 (for Core 10.3 compatibility) Active .

I think we have two separate issues, but I suppose there is a chance they are related or share the same cause.

I am attempting to upgrade a client that was on Group 1.0 and Drupal Core 10.1.

The original goal was to upgrade them to Group 2.2.x and Drupal Core 10.2.7. Now we are shooting for Group 2.3.x and core 10.3.

This problem happens in both upgrade scenarios.

When editing a group member entity, where we should see all our outsider and insider roles listed as checkable options, we see nothing (we just see the "Roles" label - but nothing beneath it). If we create a role or roles with an individual scope, we do see those listed (but as luck would have it, we have no need for individually scoped roles).

All of my prior experience with the Group module has been with version 3.0, and on sites where we have that set up, we see all group roles, so I am assuming I should see them on this site as well.

This client currently only has one insider group role, but if they ever wanted to have more than one, this would be a problem (becasue we won't be able to assign this role vs that role to the member).

So this isn't exactly a show-stopper for upgrading this site, but we would feel a lot better if this was working (and they may need additional roles in the future).

πŸ› Bug report
Status

Active

Version

2.3

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States banoodle San Francisco, CA

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

Comments & Activities

  • Issue created by @banoodle
  • I'm not a contributor on this module, but I ran into the same issue and found that for Group 3.2.2 this is caused by:

    web\modules\contrib\group\src\Plugin\EntityReferenceSelection\GroupTypeRoleSelection.php

    line 32, in the class, `GroupTypeRoleSelection` filters for only individual scoped roles.

    $query->condition('scope', PermissionScopeInterface::INDIVIDUAL_ID, '=');

    I have no idea if this is intentional or a bug, but this is preventing visibility, and thus the ability to edit a member's roles, on the group 'member edit' form. Commenting this line out restores showing all available roles.

  • I believe I understand now why this form is the way it is.

    The 'insider' and 'outsider' scopes are meant to be 1-1 associations to a global role. When setting up 'insider' and 'outsider' group roles we saying all users with this associated global role will automatically be granted these group roles, and permissions. Therefore, there is no need to have the 'insider' and 'outsider' roles in the member edit form because that member already assumes this group role per their assigned global roles. Editing whether these 'insider' and 'outsider' roles are associated to the global role, and then a user's global roles is how one would manage these relationships.

    However, if we want group roles that are group specific, that we do not want directly associated to global roles, we would then create a role with an 'individual' scope. Since there is no pre-existing global relationship with a user, these roles are then visible and assignable via the group member's edit form.

  • πŸ‡¦πŸ‡ΉAustria mvonfrie

    This is similar to ✨ Display implicit roles of group memberships Active , you must not assign insider/outsider roles, but it should be visible that the user implicitely "has" these roles.

Production build 0.71.5 2024