Subscribe to group permission is disabled
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3536774. --> Reported by: [loze](https://www.drupal.org/user/116906) Related to !43 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>See the screenshot</p> <p>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.</p> <p>This code here</p> <pre>// Show a column of disabled but checked checkboxes.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Only applies to admins or default roles.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($roles[$rid]-&gt;get('is_admin') ||<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in_array($rid_simple, $permission-&gt;getDefaultRoles())) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $form['permissions'][$permission_name][$rid]['#disabled'] = TRUE;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $form['permissions'][$permission_name][$rid]['#default_value'] = TRUE;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</pre><p> disables the checkbox if it is a default role. A default role should still be able to be unselected though.</p> <p><code>in_array($rid_simple, $permission-&gt;getDefaultRoles())</code> should select it.<br> <code>$roles[$rid]-&gt;get('is_admin')</code> should disable it. (select it too?)</p>
issue