You are here

function layout_builder_browser_update_8002 in Layout Builder Browser 8

#3184784: Ensure block config entity is installed on existing sites.

File

./layout_builder_browser.install, line 47

Code

function layout_builder_browser_update_8002() {

  /** @var \Drupal\Core\Entity\EntityTypeManager $entity_manager */
  $entity_manager = \Drupal::service('entity_type.manager');
  $entity_manager
    ->clearCachedDefinitions();
  $lbb_entity_type = $entity_manager
    ->getDefinition('layout_builder_browser_block');
  if ($lbb_entity_type && $lbb_entity_type instanceof \Drupal\Core\Entity\EntityTypeInterface) {
    \Drupal::entityDefinitionUpdateManager()
      ->installEntityType($lbb_entity_type);
  }
}