When creating an event the `Group members - visible only to group members` radio button option is visible but not accessible to select.
This is a snippet of the code from the EntityVisibilityForm.php file which might be part of the problem. Hopefully this helps.
];
$form['default_visibility'] = [
'#type' => 'select',
'#title' => $this->t('Default visibility'),
'#default_value' => $config->get('default_visibility'),
'#options' => [
'public' => $this->t('Public - visible to everyone including people who are not a member'),
'community' => $this->t('Community - visible only to logged in members'),
],
];
Notice here's no 'group' option under 'public' and 'community'. I'm not a coder so this code snippet lead could mean nothing to the cause of the problem.
Comments
Comment #2
the_glitch commentedComment #3
the_glitch commentedComment #4
ronaldtebrake commentedHi there,
Only becomes available when you select a Group in the Group selector above.
We need that context in order to know to whom (which group members) we should show whatever you are trying to create.
Comment #5
the_glitch commentedHi Ronald. Selecting a Group doesn't make the 3rd 'group' option available.
Comment #6
the_glitch commentedSelecting a group from the selector does not activate or make the 3rd radio button available.
Comment #7
the_glitch commentedComment #8
the_glitch commentedComment #9
the_glitch commentedComment #10
the_glitch commentedI just installed the latest version of OS via composer then spun up a new site through Acquia Devdesktop (same as the first site where I found the issue) and created a new group and selected that group while creating a new event and the 'group members' option isn't clickable there either. Would/could Acquia Devdesktop have something to do with it?
Comment #11
jaapjan commentedOf which group type is the group?
I just verified and it works here. By design you can only select "group members" visibility for a closed group. Changing the group may have impact on the visibility settings. For open and public there are other visibility restrictions.
Comment #13
drupal entity commentedOn custom groups is the same issue, `Group members - visible only to group members` option is visible but disabled and even when a group is selected. I understand that it works with closed and flexible groups but I think that it would be very useful to have it available to custom groups.
I tried to enable that option by modifying the function hook_social_group_allowed_visibilities_alter(array &$visibilities, $group_type_id) { on social_group.api.php on social_group like this:
but it didnt change anything. Also by changing to ($group_type_id === 'NAME_OF_THE_CUSTOM_GROUP') but with no luck. Maybe i'm missing something from this issue: https://www.drupal.org/project/social/issues/3023660
What should be the steps to enable that option? Or if it is not possible that way, i think it could be useful to add that feature in the future.