You are here

public function BlockStyleBase::validateForm in Block Style Plugins 8

Adds block style specific validation handling for the block form.

TODO: Add this to the BlockStyleInterface before 8.x-2.x.

Parameters

array $form: The form definition array for the full block configuration form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Deprecated

in 8.x-1.4 and will be removed before 8.x-2.x. Instead, you should just use validateConfigurationForm().

File

src/Plugin/BlockStyleBase.php, line 210

Class

BlockStyleBase
Base class for Block style plugins.

Namespace

Drupal\block_style_plugins\Plugin

Code

public function validateForm(array $form, FormStateInterface $form_state) {
  @trigger_error('::validateForm() is deprecated in 8.x-1.4 and will be removed before 8.x-2.x. Instead, you should just use validateConfigurationForm(). See https://www.drupal.org/project/block_style_plugins/issues/3020109.', E_USER_DEPRECATED);

  // Allow plugins to manipulate the validateForm.
  $subform_state = SubformState::createForSubform($form['third_party_settings']['block_style_plugins'][$this->pluginId], $form, $form_state);
  $this
    ->validateConfigurationForm($form['third_party_settings']['block_style_plugins'][$this->pluginId], $subform_state);
}