public function BlockPluginUI::formValidate

Overrides \Drupal\system\Plugin\PluginUIBase::formValidate().

Overrides PluginUIBase::formValidate

File

drupal/core/modules/block/lib/Drupal/block/Plugin/PluginUI/BlockPluginUI.php, line 111

Class

BlockPluginUI
Defines an overrideable UI for block selection, configuration, and placement.

Namespace

Drupal\block\Plugin\PluginUI

Code

public function formValidate($form, &$form_state) {
  $definitions = $form_state['values']['manager']
    ->getDefinitions();
  if (!isset($definitions[$form_state['values']['block']])) {
    form_set_error('block', t('You must select a valid block.'));
  }
}