diff --git a/dgi_actions.post_update.php b/dgi_actions.post_update.php new file mode 100644 index 0000000..d914f05 --- /dev/null +++ b/dgi_actions.post_update.php @@ -0,0 +1,47 @@ +getStorage('dgiactions_dataprofile')->loadMultiple(); + yield from $entity_type_manager->getStorage('dgiactions_servicedata')->loadMultiple(); + yield from $entity_type_manager->getStorage('dgiactions_identifier')->loadMultiple(); + + foreach ($entity_type_manager->getStorage('action')->loadByProperties(['type' => 'entity']) as $id => $action) { + if ($action instanceof IdentifierAction) { + yield $id => $action; + } + } + + /** + * @var string $id + * @var \Drupal\context\ContextInterface $context + */ + foreach ($entity_type_manager->getStorage('context')->loadMultiple() as $id => $context) { + if ( + $context->hasCondition('dgi_actions_entity_persistent_identifier_populated') || + $context->hasReaction('dgi_actions_entity_mint_reaction') || + $context->hasReaction('dgi_actions_entity_delete_reaction') + ) { + yield $id => $context; + } + } + }; + + /** @var \Drupal\Core\Entity\EntityInterface $config_entity */ + foreach ($to_resave() as $config_entity) { + $config_entity->save(); + } + +}