You are here

function social_user_update_8001 in Open Social 10.1.x

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

Fix 2 wrongly saved view displays.

File

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

Code

function social_user_update_8001(&$sandbox) {

  /** @var \Drupal\Core\Config\Config|\Drupal\Core\Config\ImmutableConfig $conf_default */
  $conf_default = \Drupal::getContainer()
    ->get('config.factory')
    ->getEditable('core.entity_view_display.user.user.default');

  /** @var \Drupal\Core\Config\Config|\Drupal\Core\Config\ImmutableConfig $conf_full */
  $conf_full = \Drupal::getContainer()
    ->get('config.factory')
    ->getEditable('core.entity_view_display.user.user.full');

  /*
   * For both these displays, the content is empty.
   * In a previous version 3 subfields were exported into the root level of
   * 'content'.
   * This removes those fields that have no purpose and makes sure
   * the update hook for Drupal 8.3.1 works properly.
   */
  $conf_default
    ->set('content', [])
    ->save();
  $conf_full
    ->set('content', [])
    ->save();
}