Same name and namespace in other branches
  1. 8.9.x core/modules/block/src/BlockListBuilder.php \Drupal\block\BlockListBuilder::validateForm()
  2. 9 core/modules/block/src/BlockListBuilder.php \Drupal\block\BlockListBuilder::validateForm()

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 FormInterface::validateForm

File

core/modules/block/src/BlockListBuilder.php, line 374

Class

BlockListBuilder
Defines a class to build a listing of block entities.

Namespace

Drupal\block

Code

public function validateForm(array &$form, FormStateInterface $form_state) {
  if (empty($form_state
    ->getValue('blocks'))) {
    $form_state
      ->setErrorByName('blocks', $this
      ->t('No blocks settings to update.'));
  }
}