webform_group does not recognize the member role if no group role is assigned

Created on 14 November 2023, about 1 year ago

Forms that should only be visible to members of a group are not visible

The problem occurs when the user has no other role in the group, only the membership.

If a role is given to the user, also the membership is detected. If there isn´t a special user-role, the array of $current_user_group_roles will be empty. The form is not shown, even if there is a membership.

(webform_group.module, line 293)

$current_user_group_roles = {string[2]} ["mygroup-sp...", "mygroup-me..."]
 mygroup-specialrole = "mygroup-specialrole"
 mygroup-member = "mygroup-member"

Steps to reproduce

Tested with groups version: 2.2.1

Create a form with no access for non-admin-user-roles. Configure access for "Group (node) roles". Choose an available group role.
Create user in this group, only membership, no group-role.
User should have access to the form, but hasn´t.

Proposed resolution

Change code, that also the membership is detected here.

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇩🇪Germany martinelkb

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

Comments & Activities

Production build 0.71.5 2024