You are here

public function BlockContentBlock::blockSubmit in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/block_content/src/Plugin/Block/BlockContentBlock.php \Drupal\block_content\Plugin\Block\BlockContentBlock::blockSubmit()

Overrides BlockPluginTrait::blockSubmit

File

core/modules/block_content/src/Plugin/Block/BlockContentBlock.php, line 166

Class

BlockContentBlock
Defines a generic custom block type.

Namespace

Drupal\block_content\Plugin\Block

Code

public function blockSubmit($form, FormStateInterface $form_state) {

  // Invalidate the block cache to update custom block-based derivatives.
  $this->configuration['view_mode'] = $form_state
    ->getValue('view_mode');
  $this->blockManager
    ->clearCachedDefinitions();
}