Subscribe to group permission is disabled

Created on 18 July 2025, 4 days ago

Problem/Motivation

See the screenshot

The checkbox for non-members to subscribe to the group is greyed out and checked. I want to have an admin add people to a group and not have to subscribe themselves, but I cant uncheck this.

This code here

// Show a column of disabled but checked checkboxes.
            // Only applies to admins or default roles.
            if ($roles[$rid]->get('is_admin') ||
                in_array($rid_simple, $permission->getDefaultRoles())) {
              $form['permissions'][$permission_name][$rid]['#disabled'] = TRUE;
              $form['permissions'][$permission_name][$rid]['#default_value'] = TRUE;
            }

disables the checkbox if it is a default role. A default role should still be able to be unselected though.

in_array($rid_simple, $permission->getDefaultRoles()) should select it.
$roles[$rid]->get('is_admin') should disable it. (select it too?)

🐛 Bug report
Status

Active

Version

2.0

Component

og.module

Created by

🇺🇸United States loze Los Angeles

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

Comments & Activities

  • Issue created by @loze
  • 🇺🇸United States loze Los Angeles
  • @loze opened merge request.
  • 🇺🇸United States loze Los Angeles

    MR43 Removes setting #disabled for default roles, it only sets them for the admin role.

    Also if I'm not mistaken, there isn't a need to set the default value here, the defaults for each permission have already been populated.
    Without doing this, permissions that have a default role to able to be unchecked.

    This allows me to uncheck the "subscribe to group" permission for non-members.

  • 🇮🇱Israel amitaibu Israel

    Thanks, @loze. Can you please attach a screenshot showing what has changed?

    Also, could you add tests to the MR?

  • 🇺🇸United States loze Los Angeles

    here is a screenshot of the checkbox becoming active after the patch.

    Unfortunately, I'm not really sure what to do for adding a test. Hopefully someone else can help out with that.

Production build 0.71.5 2024