function ConfigHandlerGroup::submitForm

Same name and namespace in other branches
  1. 11.x 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()
  3. 9 core/modules/views_ui/src/Form/Ajax/ConfigHandlerGroup.php \Drupal\views_ui\Form\Ajax\ConfigHandlerGroup::submitForm()
  4. 8.9.x core/modules/views_ui/src/Form/Ajax/ConfigHandlerGroup.php \Drupal\views_ui\Form\Ajax\ConfigHandlerGroup::submitForm()

Overrides ViewsFormBase::submitForm

File

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

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');
  // Use the same handler that built the form. When aggregation is enabled,
  // the display swaps in the aggregation handler, so recreating the handler
  // from the item would submit with a different handler than the one whose
  // form elements were displayed.
  $handler = $form_state->get('handler');
  $item =& $handler->options;
  $handler->submitGroupByForm($form, $form_state);
  // Store the item back on the view.
  $view->getExecutable()
    ->setHandler($form_state->get('display_id'), $form_state->get('type'), $form_state->get('id'), $item);
  // Write to cache.
  $view->cacheSet();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.