You are here

public function BlockContentBlock::blockSubmit in Drupal 10

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()
  2. 9 core/modules/block_content/src/Plugin/Block/BlockContentBlock.php \Drupal\block_content\Plugin\Block\BlockContentBlock::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();
}