You are here

public function FilterPluginBase::buildGroupForm in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/views/src/Plugin/views/filter/FilterPluginBase.php \Drupal\views\Plugin\views\filter\FilterPluginBase::buildGroupForm()

Displays the Build Group form.

File

core/modules/views/src/Plugin/views/filter/FilterPluginBase.php, line 440

Class

FilterPluginBase
Base class for Views filters handler plugins.

Namespace

Drupal\views\Plugin\views\filter

Code

public function buildGroupForm($form, FormStateInterface $form_state) {
  $item =& $this->options;

  // flip. If the filter was a group, set back to a standard filter.
  $item['is_grouped'] = empty($item['is_grouped']);

  // If necessary, set new defaults:
  if ($item['is_grouped']) {
    $this
      ->buildGroupOptions();
  }
  $view = $form_state
    ->get('view');
  $display_id = $form_state
    ->get('display_id');
  $type = $form_state
    ->get('type');
  $id = $form_state
    ->get('id');
  $view
    ->getExecutable()
    ->setHandler($display_id, $type, $id, $item);
  $view
    ->addFormToStack($form_state
    ->get('form_key'), $display_id, $type, $id, TRUE, TRUE);
  $view
    ->cacheSet();
  $form_state
    ->set('rerender', TRUE);
  $form_state
    ->setRebuild();
  $form_state
    ->get('force_build_group_options', TRUE);
}