Skip to content
This repository has been archived by the owner on Aug 18, 2024. It is now read-only.

Commit

Permalink
Improve the post update messages
Browse files Browse the repository at this point in the history
  • Loading branch information
bboro committed Sep 6, 2021
1 parent 5c42ecb commit 4878cf2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions og.post_update.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ function og_post_update_og_membership_state_field(&$sandbox) {
$definition_manager = \Drupal::service('entity.definition_update_manager');
if (!$definition_manager->needsUpdates()) {
// No updates necessary.
return t('No entity updates to run');
return t('No entity updates to run.');
}
$change_list = $definition_manager->getChangeList();
if (empty($change_list['og_membership']['field_storage_definitions']['state'])) {
return t('No entity updates to run');
return t('State field on OG Membership entity is already up to date.');
}
$entity_type_manager = \Drupal::service('entity_type.manager');
$bundle_of = 'og_membership';
Expand Down Expand Up @@ -87,4 +87,5 @@ function og_post_update_og_membership_state_field(&$sandbox) {
->condition($entity_id_key, $id)
->execute();
}
return t('State field on OG Membership entity was updated.');
}

0 comments on commit 4878cf2

Please sign in to comment.