You are here

public function ConfigHandlerGroup::submitForm in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/views_ui/src/Form/Ajax/ConfigHandlerGroup.php \Drupal\views_ui\Form\Ajax\ConfigHandlerGroup::submitForm()
  2. 10 core/modules/views_ui/src/Form/Ajax/ConfigHandlerGroup.php \Drupal\views_ui\Form\Ajax\ConfigHandlerGroup::submitForm()

Form submission handler.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Overrides ViewsFormBase::submitForm

File

core/modules/views_ui/src/Form/Ajax/ConfigHandlerGroup.php, line 97

Class

ConfigHandlerGroup
Provides a form for configuring grouping information for a Views UI handler.

Namespace

Drupal\views_ui\Form\Ajax

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $view = $form_state
    ->get('view');
  $item =& $form_state
    ->get('handler')->options;
  $type = $form_state
    ->get('type');
  $handler = Views::handlerManager($type)
    ->getHandler($item);
  $executable = $view
    ->getExecutable();
  $handler
    ->init($executable, $executable->display_handler, $item);
  $handler
    ->submitGroupByForm($form, $form_state);

  // Store the item back on the view
  $executable
    ->setHandler($form_state
    ->get('display_id'), $form_state
    ->get('type'), $form_state
    ->get('id'), $item);

  // Write to cache
  $view
    ->cacheSet();
}