You are here

public function SocialGroupViewsBulkOperationsBulkForm::viewsFormSubmit in Open Social 8.8

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_group/src/Plugin/views/field/SocialGroupViewsBulkOperationsBulkForm.php \Drupal\social_group\Plugin\views\field\SocialGroupViewsBulkOperationsBulkForm::viewsFormSubmit()
  2. 8.5 modules/social_features/social_group/src/Plugin/views/field/SocialGroupViewsBulkOperationsBulkForm.php \Drupal\social_group\Plugin\views\field\SocialGroupViewsBulkOperationsBulkForm::viewsFormSubmit()
  3. 8.6 modules/social_features/social_group/src/Plugin/views/field/SocialGroupViewsBulkOperationsBulkForm.php \Drupal\social_group\Plugin\views\field\SocialGroupViewsBulkOperationsBulkForm::viewsFormSubmit()
  4. 8.7 modules/social_features/social_group/src/Plugin/views/field/SocialGroupViewsBulkOperationsBulkForm.php \Drupal\social_group\Plugin\views\field\SocialGroupViewsBulkOperationsBulkForm::viewsFormSubmit()
  5. 10.3.x modules/social_features/social_group/src/Plugin/views/field/SocialGroupViewsBulkOperationsBulkForm.php \Drupal\social_group\Plugin\views\field\SocialGroupViewsBulkOperationsBulkForm::viewsFormSubmit()
  6. 10.0.x modules/social_features/social_group/src/Plugin/views/field/SocialGroupViewsBulkOperationsBulkForm.php \Drupal\social_group\Plugin\views\field\SocialGroupViewsBulkOperationsBulkForm::viewsFormSubmit()
  7. 10.1.x modules/social_features/social_group/src/Plugin/views/field/SocialGroupViewsBulkOperationsBulkForm.php \Drupal\social_group\Plugin\views\field\SocialGroupViewsBulkOperationsBulkForm::viewsFormSubmit()
  8. 10.2.x modules/social_features/social_group/src/Plugin/views/field/SocialGroupViewsBulkOperationsBulkForm.php \Drupal\social_group\Plugin\views\field\SocialGroupViewsBulkOperationsBulkForm::viewsFormSubmit()

File

modules/social_features/social_group/src/Plugin/views/field/SocialGroupViewsBulkOperationsBulkForm.php, line 219

Class

SocialGroupViewsBulkOperationsBulkForm
Defines the Groups Views Bulk Operations field plugin.

Namespace

Drupal\social_group\Plugin\views\field

Code

public function viewsFormSubmit(array &$form, FormStateInterface $form_state) {
  parent::viewsFormSubmit($form, $form_state);
  if ($form_state
    ->get('step') === 'views_form_views_form' && $this->view
    ->id() === 'group_manage_members') {

    /** @var \Drupal\Core\Url $url */
    $url = $form_state
      ->getRedirect();
    if ($url
      ->getRouteName() === 'views_bulk_operations.execute_configurable') {
      $parameters = $url
        ->getRouteParameters();
      if (empty($parameters['group'])) {
        $group = _social_group_get_current_group();
        $parameters['group'] = $group
          ->id();
      }
      $url = Url::fromRoute('social_group_gvbo.views_bulk_operations.execute_configurable', [
        'group' => $parameters['group'],
      ]);
      $form_state
        ->setRedirectUrl($url);
    }
  }
}