function BlockListBuilder::validateForm

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

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.'));
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.