function social_activity_update_8003 in Open Social 8.7
Same name and namespace in other branches
- 8.9 modules/social_features/social_activity/social_activity.install \social_activity_update_8003()
- 8 modules/social_features/social_activity/social_activity.install \social_activity_update_8003()
- 8.2 modules/social_features/social_activity/social_activity.install \social_activity_update_8003()
- 8.3 modules/social_features/social_activity/social_activity.install \social_activity_update_8003()
- 8.4 modules/social_features/social_activity/social_activity.install \social_activity_update_8003()
- 8.5 modules/social_features/social_activity/social_activity.install \social_activity_update_8003()
- 8.6 modules/social_features/social_activity/social_activity.install \social_activity_update_8003()
- 8.8 modules/social_features/social_activity/social_activity.install \social_activity_update_8003()
- 10.3.x modules/social_features/social_activity/social_activity.install \social_activity_update_8003()
- 10.0.x modules/social_features/social_activity/social_activity.install \social_activity_update_8003()
- 10.1.x modules/social_features/social_activity/social_activity.install \social_activity_update_8003()
- 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();
}
}
}