You are here

function social_activity_update_8003 in Open Social 8.4

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

Update Dynamic Entity Reference.

Related configs to work with latest version of DER.

File

modules/social_features/social_activity/social_activity.install, line 176
The Social activity install.

Code

function social_activity_update_8003() {
  $config = \Drupal::service('config.factory')
    ->getEditable('core.entity_view_display.activity.activity.default');

  // Only update if config exists and this is not a fresh install.
  if (!empty($config) && !empty($settings = $config
    ->get('content.field_activity_entity.settings'))) {
    if (!empty($settings['view_mode'])) {
      $config
        ->clear('content.field_activity_entity.settings');
      $config
        ->set('content.field_activity_entity.settings', social_activity_get_der_settings());
      $config
        ->save();
    }
  }
}