You are here

function authorization_update_8001 in Authorization 8

Schema corrections.

File

./authorization.install, line 15
Contains installation and update hooks.

Code

function authorization_update_8001() {
  $config_factory = \Drupal::configFactory();
  $config = $config_factory
    ->getEditable('authorization.settings');
  $config
    ->set('authorization_message', $config
    ->get('authorization_message'));
  $config
    ->clear('authorization_message');
  $config
    ->save();
  $result = \Drupal::entityQuery('authorization_profile')
    ->execute();
  $profiles = AuthorizationProfile::loadMultiple($result);
  foreach ($profiles as $profile) {
    $profile
      ->save();
  }
  return t('Your authorization configuration and profiles have been updated, please review.');
}