Skip to content

Commit

Permalink
Update field definitions.
Browse files Browse the repository at this point in the history
  • Loading branch information
emerham committed Mar 14, 2023
1 parent 3f43e67 commit 6ee740b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion osu_block_types.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 21 additions & 0 deletions osu_block_types.install
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down

0 comments on commit 6ee740b

Please sign in to comment.