function CommentAdminOverview::validateForm
Same name in other branches
- 9 core/modules/comment/src/Form/CommentAdminOverview.php \Drupal\comment\Form\CommentAdminOverview::validateForm()
- 10 core/modules/comment/src/Form/CommentAdminOverview.php \Drupal\comment\Form\CommentAdminOverview::validateForm()
- 11.x core/modules/comment/src/Form/CommentAdminOverview.php \Drupal\comment\Form\CommentAdminOverview::validateForm()
Overrides FormBase::validateForm
File
-
core/
modules/ comment/ src/ Form/ CommentAdminOverview.php, line 256
Class
- CommentAdminOverview
- Provides the comments overview administration form.
Namespace
Drupal\comment\FormCode
public function validateForm(array &$form, FormStateInterface $form_state) {
$form_state->setValue('comments', array_diff($form_state->getValue('comments'), [
0,
]));
// We can't execute any 'Update options' if no comments were selected.
if (count($form_state->getValue('comments')) == 0) {
$form_state->setErrorByName('', $this->t('Select one or more comments to perform the update on.'));
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.