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

CodeJynx created an issue. See original summary.

the_glitch’s picture

Issue summary: View changes
the_glitch’s picture

Issue summary: View changes
ronaldtebrake’s picture

Category: Bug report » Support request
Status: Active » Closed (works as designed)

Hi there,

Group members - visible only to group members

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.

the_glitch’s picture

Hi Ronald. Selecting a Group doesn't make the 3rd 'group' option available.

the_glitch’s picture

Selecting a group from the selector does not activate or make the 3rd radio button available.

the_glitch’s picture

Status: Closed (works as designed) » Active
the_glitch’s picture

Category: Support request » Bug report
the_glitch’s picture

Component: Groups » Code (back-end)
the_glitch’s picture

I 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?

jaapjan’s picture

Status: Active » Fixed
StatusFileSize
new475.38 KB

Of 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.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

drupal entity’s picture

On 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:

function hook_social_group_allowed_visibilities_alter(array &$visibilities, $group_type_id) {
  if ($group_type_id === 'custom_public_group') {
    $visibilities['community'] = TRUE;
    $visibilities['group'] = TRUE;
  };

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.