function BlockPluginTrait::validateConfigurationForm

Same name in other branches
  1. 9 core/lib/Drupal/Core/Block/BlockPluginTrait.php \Drupal\Core\Block\BlockPluginTrait::validateConfigurationForm()
  2. 10 core/lib/Drupal/Core/Block/BlockPluginTrait.php \Drupal\Core\Block\BlockPluginTrait::validateConfigurationForm()
  3. 11.x core/lib/Drupal/Core/Block/BlockPluginTrait.php \Drupal\Core\Block\BlockPluginTrait::validateConfigurationForm()

Most block plugins should not override this method. To add validation for a specific block type, override BlockBase::blockValidate().

See also

\Drupal\Core\Block\BlockBase::blockValidate()

File

core/lib/Drupal/Core/Block/BlockPluginTrait.php, line 203

Class

BlockPluginTrait
Provides the base implementation of a block plugin.

Namespace

Drupal\Core\Block

Code

public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
    // Remove the admin_label form item element value so it will not persist.
    $form_state->unsetValue('admin_label');
    $this->blockValidate($form, $form_state);
}

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