You are here

function social_user_update_8004 in Open Social 8.6

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_user/social_user.install \social_user_update_8004()
  2. 8 modules/social_features/social_user/social_user.install \social_user_update_8004()
  3. 8.2 modules/social_features/social_user/social_user.install \social_user_update_8004()
  4. 8.3 modules/social_features/social_user/social_user.install \social_user_update_8004()
  5. 8.4 modules/social_features/social_user/social_user.install \social_user_update_8004()
  6. 8.5 modules/social_features/social_user/social_user.install \social_user_update_8004()
  7. 8.7 modules/social_features/social_user/social_user.install \social_user_update_8004()
  8. 8.8 modules/social_features/social_user/social_user.install \social_user_update_8004()
  9. 10.3.x modules/social_features/social_user/social_user.install \social_user_update_8004()
  10. 10.0.x modules/social_features/social_user/social_user.install \social_user_update_8004()
  11. 10.1.x modules/social_features/social_user/social_user.install \social_user_update_8004()
  12. 10.2.x modules/social_features/social_user/social_user.install \social_user_update_8004()

Migrate navigation settings into the correct format.

File

modules/social_features/social_user/social_user.install, line 72
Install, update and uninstall functions for the social_user module.

Code

function social_user_update_8004() {
  $old_config = \Drupal::getContainer()
    ->get('config.factory')
    ->getEditable('social_user_navigation.settings');
  $new_config = \Drupal::getContainer()
    ->get('config.factory')
    ->getEditable('social_user.navigation.settings');

  // Store the values.
  $new_config
    ->setData($old_config
    ->getRawData());

  // Remove the old config altogether.
  $old_config
    ->delete();
}