Overrides \Drupal\system\Plugin\PluginUIBase::formValidate().
Overrides PluginUIBase::formValidate
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.'));
}
}