public CommentAdminOverview::validateForm(array &$form, FormStateInterface $form_state)
Form validation handler.
Parameters
array $form: An associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Overrides FormBase::validateForm
File
- core/modules/comment/src/Form/CommentAdminOverview.php, line 244
Class
- CommentAdminOverview
- Provides the comments overview administration form.
Namespace
Drupal\comment\Form
Code
public function validateForm(array &$form, FormStateInterface $form_state) { $form_state->setValue('comments', array_diff($form_state->getValue('comments'), array(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.')); } }
Please login to continue.