You are here

public function InlineBlock::blockForm in Layout Builder Symmetric Translations 8

Remove if fixed.

Overrides InlineBlock::blockForm

File

src/Plugin/Block/InlineBlock.php, line 20

Class

InlineBlock
InlineBlock overridden to load correct block for editing.

Namespace

Drupal\layout_builder_st\Plugin\Block

Code

public function blockForm($form, FormStateInterface $form_state) {
  $form = parent::blockForm($form, $form_state);
  $block = $this
    ->getEntity();
  if (!$this->isNew && !$block
    ->isNew()) {

    // Get the active block for editing purposes.
    $block = \Drupal::service('entity.repository')
      ->getActive('block_content', $block
      ->id());
  }
  $form['block_form']['#block'] = $block;
  return $form;
}