You are here

public function SocialGroupViewsBulkOperationsBulkForm::viewsFormValidate in Open Social 8.6

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::viewsFormValidate()
  2. 8.5 modules/social_features/social_group/src/Plugin/views/field/SocialGroupViewsBulkOperationsBulkForm.php \Drupal\social_group\Plugin\views\field\SocialGroupViewsBulkOperationsBulkForm::viewsFormValidate()
  3. 8.7 modules/social_features/social_group/src/Plugin/views/field/SocialGroupViewsBulkOperationsBulkForm.php \Drupal\social_group\Plugin\views\field\SocialGroupViewsBulkOperationsBulkForm::viewsFormValidate()
  4. 8.8 modules/social_features/social_group/src/Plugin/views/field/SocialGroupViewsBulkOperationsBulkForm.php \Drupal\social_group\Plugin\views\field\SocialGroupViewsBulkOperationsBulkForm::viewsFormValidate()
  5. 10.3.x modules/social_features/social_group/src/Plugin/views/field/SocialGroupViewsBulkOperationsBulkForm.php \Drupal\social_group\Plugin\views\field\SocialGroupViewsBulkOperationsBulkForm::viewsFormValidate()
  6. 10.0.x modules/social_features/social_group/src/Plugin/views/field/SocialGroupViewsBulkOperationsBulkForm.php \Drupal\social_group\Plugin\views\field\SocialGroupViewsBulkOperationsBulkForm::viewsFormValidate()
  7. 10.1.x modules/social_features/social_group/src/Plugin/views/field/SocialGroupViewsBulkOperationsBulkForm.php \Drupal\social_group\Plugin\views\field\SocialGroupViewsBulkOperationsBulkForm::viewsFormValidate()
  8. 10.2.x modules/social_features/social_group/src/Plugin/views/field/SocialGroupViewsBulkOperationsBulkForm.php \Drupal\social_group\Plugin\views\field\SocialGroupViewsBulkOperationsBulkForm::viewsFormValidate()

File

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

Class

SocialGroupViewsBulkOperationsBulkForm
Defines the Groups Views Bulk Operations field plugin.

Namespace

Drupal\social_group\Plugin\views\field

Code

public function viewsFormValidate(&$form, FormStateInterface $form_state) {
  if ($this->view
    ->id() === 'group_manage_members' && $this->options['buttons']) {
    $user_input = $form_state
      ->getUserInput();
    foreach (Element::children($form['actions']) as $action) {

      /** @var \Drupal\Core\StringTranslation\TranslatableMarkup $label */
      $label = $form['actions'][$action]['#value'];
      if (strip_tags($label
        ->render()) === $user_input['op']) {
        $form_state
          ->setTriggeringElement($form['actions'][$action]);
        break;
      }
    }
  }
  parent::viewsFormValidate($form, $form_state);
}