You are here

public function BlockPluginTrait::validateConfigurationForm in Drupal 9

Same name and namespace in other branches
  1. 8 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()

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()

1 call to BlockPluginTrait::validateConfigurationForm()
ValidationErrorBlock::validateConfigurationForm in core/modules/settings_tray/tests/modules/settings_tray_test/src/Plugin/Block/ValidationErrorBlock.php
Most block plugins should not override this method. To add validation for a specific block type, override BlockBase::blockValidate().
1 method overrides BlockPluginTrait::validateConfigurationForm()
ValidationErrorBlock::validateConfigurationForm in core/modules/settings_tray/tests/modules/settings_tray_test/src/Plugin/Block/ValidationErrorBlock.php
Most block plugins should not override this method. To add validation for a specific block type, override BlockBase::blockValidate().

File

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

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