public function MefibsDisplayExtender::validateOptionsForm in MEFIBS - More exposed forms in blocks 8
Handle any special handling on the form submission.
Overrides DisplayExtenderPluginBase::validateOptionsForm
File
- lib/
Drupal/ mefibs/ Plugin/ views/ display_extender/ MefibsDisplayExtender.php, line 228 - Contains \Drupal\mefibs\Plugin\views\display_extender\MefibsDisplayExtender.
Class
- MefibsDisplayExtender
- Plugin annotation @ViewsDisplayExtender( id = "mefibs", title = @Translation("Mefibs"), help = @Translation("Provides additional exposed filter blocks for this view."), no_ui = FALSE )
Namespace
Drupal\mefibs\Plugin\views\display_extenderCode
public function validateOptionsForm(&$form, &$form_state) {
if ($form_state['type'] != 'mefibs') {
return;
}
$values = $form_state['values'];
$add_block = $values['mefibs']['add_block'];
$button = $form_state['triggering_element'];
if (isset($button['#group']) && $button['#group'] === 'add') {
// New block should be added, check for submitted values
if (empty($add_block['name'])) {
form_set_error('mefibs][add_block][name', t('Please enter a name for the block.'));
}
}
}