You are here

public function ConfigHandlerGroup::submitForm in Drupal 10

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. 9 core/modules/views_ui/src/Form/Ajax/ConfigHandlerGroup.php \Drupal\views_ui\Form\Ajax\ConfigHandlerGroup::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();
}