Commit faac96e8 authored by Andrii Chyrskyi's avatar Andrii Chyrskyi Committed by Andrii Chyrskyi
Browse files

Merge pull request #2696 from...

Merge pull request #2696 from goalgorilla/bugfix/3258123-vbo-actions-on-group-membership-not-working

Issue #3258123 by hitesh-jain, tbsiqueira: VBO actions on Group membership not working
parent 82d55cfb
Loading
Loading
Loading
Loading
+12 −5
Changes for modules/social_features/social_group/src/Plugin/views/field/SocialGroupViewsBulkOperationsBulkForm.php: 12 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -199,13 +199,19 @@ class SocialGroupViewsBulkOperationsBulkForm extends ViewsBulkOperationsBulkForm
    if ($this->view->id() === 'group_manage_members') {
      $user_input = $form_state->getUserInput();
      $available_options = $this->getBulkOptions();

      $selected_actions = array_combine(
        array_keys($this->options['selected_actions']),
        array_column($this->options['selected_actions'], 'action_id')
      );

      // Grab all the actions that are available.
      foreach (Element::children($this->actions) as $action) {
        // If the option is not in our selected options, next.
        if (($action_key = array_search($action, array_column($this->options['selected_actions'], 'action_id'))) === FALSE) {
          continue;
        }

        // Check if we have the command.
        if (
          is_array($selected_actions) &&
          ($action_key = array_search($action, $selected_actions)) !== FALSE
        ) {
          /** @var \Drupal\Core\StringTranslation\TranslatableMarkup $label */
          $label = $available_options[$action_key];

@@ -221,6 +227,7 @@ class SocialGroupViewsBulkOperationsBulkForm extends ViewsBulkOperationsBulkForm
          }
        }
      }
    }

    parent::viewsFormValidate($form, $form_state);
  }