function BlockForm::validateForm
Same name in other branches
- 9 core/modules/block/src/BlockForm.php \Drupal\block\BlockForm::validateForm()
- 10 core/modules/block/src/BlockForm.php \Drupal\block\BlockForm::validateForm()
- 11.x core/modules/block/src/BlockForm.php \Drupal\block\BlockForm::validateForm()
Overrides FormBase::validateForm
File
-
core/
modules/ block/ src/ BlockForm.php, line 305
Class
- BlockForm
- Provides form for block instance forms.
Namespace
Drupal\blockCode
public function validateForm(array &$form, FormStateInterface $form_state) {
parent::validateForm($form, $form_state);
$form_state->setValue('weight', (int) $form_state->getValue('weight'));
// The Block Entity form puts all block plugin form elements in the
// settings form element, so just pass that to the block for validation.
$this->getPluginForm($this->entity
->getPlugin())
->validateConfigurationForm($form['settings'], SubformState::createForSubform($form['settings'], $form, $form_state));
$this->validateVisibility($form, $form_state);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.