You are here

public function DashboardBlockFormBase::validateForm in Draggable dashboard 8.2

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

src/Form/DashboardBlockFormBase.php, line 151

Class

DashboardBlockFormBase
Class DashboardBlockFormBase

Namespace

Drupal\draggable_dashboard\Form

Code

public function validateForm(array &$form, FormStateInterface $form_state) {
  parent::validateForm($form, $form_state);

  // The Block Entity form puts all block plugin form elements in the
  // settings form element, so just pass that to the block for validation.

  /** @var BlockPluginInterface $block_instance */
  $block_instance = $this->blockManager
    ->createInstance($this->block['settings']['id']);
  $this
    ->getPluginForm($block_instance)
    ->validateConfigurationForm($form['settings'], SubformState::createForSubform($form['settings'], $form, $form_state));
}