public function PurgeBlockForm::validateForm in Purge 8.3
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
- modules/
purge_ui/ src/ Form/ PurgeBlockForm.php, line 193
Class
- PurgeBlockForm
- End-user form for \Drupal\purge_ui\Plugin\Block\PurgeBlock.
Namespace
Drupal\purge_ui\FormCode
public function validateForm(array &$form, FormStateInterface $form_state) {
if (empty($form_state
->getBuildInfo()['expressions'])) {
$form_state
->setErrorByName('submit', $this
->t('Invalid form submission.'));
}
if ($this->config['execution'] === 'direct' && !$this->processor) {
$form_state
->setErrorByName('submit', $this
->t('Please contact your site administrator to enable the block processor plugin.'));
}
if ($this->config['execution'] === 'queue' && !$this->queuer) {
$form_state
->setErrorByName('submit', $this
->t('Please contact your site administrator to enable the block queuer plugin.'));
}
}