function FilterPluginBase::showBuildGroupForm
Same name in other branches
- 8.9.x core/modules/views/src/Plugin/views/filter/FilterPluginBase.php \Drupal\views\Plugin\views\filter\FilterPluginBase::showBuildGroupForm()
- 10 core/modules/views/src/Plugin/views/filter/FilterPluginBase.php \Drupal\views\Plugin\views\filter\FilterPluginBase::showBuildGroupForm()
- 11.x core/modules/views/src/Plugin/views/filter/FilterPluginBase.php \Drupal\views\Plugin\views\filter\FilterPluginBase::showBuildGroupForm()
Shortcut to display the exposed options form.
1 call to FilterPluginBase::showBuildGroupForm()
- FilterPluginBase::buildOptionsForm in core/
modules/ views/ src/ Plugin/ views/ filter/ FilterPluginBase.php - Provide the basic form which calls through to subforms.
File
-
core/
modules/ views/ src/ Plugin/ views/ filter/ FilterPluginBase.php, line 371
Class
- FilterPluginBase
- Base class for Views filters handler plugins.
Namespace
Drupal\views\Plugin\views\filterCode
public function showBuildGroupForm(&$form, FormStateInterface $form_state) {
if (empty($this->options['is_grouped'])) {
return;
}
$this->buildExposedFiltersGroupForm($form, $form_state);
// When we click the expose button, we add new gadgets to the form but they
// have no data in POST so their defaults get wiped out. This prevents
// these defaults from getting wiped out. This setting will only be TRUE
// during a 2nd pass rerender.
if ($form_state->get('force_build_group_options')) {
foreach (Element::children($form['group_info']) as $id) {
if (isset($form['group_info'][$id]['#default_value']) && !isset($form['group_info'][$id]['#value'])) {
$form['group_info'][$id]['#value'] = $form['group_info'][$id]['#default_value'];
}
}
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.