diff --git a/osu_block_types.info.yml b/osu_block_types.info.yml index 2225368..0e07325 100644 --- a/osu_block_types.info.yml +++ b/osu_block_types.info.yml @@ -3,7 +3,7 @@ type: module description: Create Different Blocks types for use in OSU Drupal. package: OSU core_version_requirement: ^9 || ^10 -version: 1.0.10 +version: 1.0.11 dependencies: - core:block - core:layout_builder diff --git a/osu_block_types.install b/osu_block_types.install index dd14eb6..8e323e4 100644 --- a/osu_block_types.install +++ b/osu_block_types.install @@ -5,6 +5,27 @@ use Drupal\Core\Config\FileStorage; use Drupal\field\Entity\FieldConfig; use Drupal\field\Entity\FieldStorageConfig; +/** + * Update field definitions. + */ +function osu_block_types_update_9006(&$sandbox) { + $entity_type_manager = \Drupal::entityTypeManager(); + $entity_type_manager->clearCachedDefinitions(); + + $entity_type_ids = []; + $change_summary = \Drupal::service('entity.definition_update_manager') + ->getChangeSummary(); + foreach ($change_summary as $entity_type_id => $change_list) { + $entity_type = $entity_type_manager->getDefinition($entity_type_id); + \Drupal::entityDefinitionUpdateManager()->installEntityType($entity_type); + $entity_type_ids[] = $entity_type_id; + } + drupal_flush_all_caches(); + return t("Installed/Updated the entity type(s): @entity_type_ids", [ + '@entity_type_ids' => implode(', ', $entity_type_ids), + ]); +} + /** * Add new block type OSU Menu Bar Item. */