You are here

function social_activity_update_8801 in Open Social 10.3.x

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_activity/social_activity.install \social_activity_update_8801()
  2. 8.8 modules/social_features/social_activity/social_activity.install \social_activity_update_8801()
  3. 10.0.x modules/social_features/social_activity/social_activity.install \social_activity_update_8801()
  4. 10.1.x modules/social_features/social_activity/social_activity.install \social_activity_update_8801()
  5. 10.2.x modules/social_features/social_activity/social_activity.install \social_activity_update_8801()

Update activity stream block descriptions.

File

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

Code

function social_activity_update_8801() {
  $config_factory = \Drupal::configFactory();

  // Load the activity stream.
  $view = $config_factory
    ->getEditable('views.view.activity_stream');
  $displays = $view
    ->get('display');

  // Update block_descriptions for the stream blocks.
  foreach ($displays as $display_name => &$display) {
    if ($display_name === 'block_stream_homepage') {
      $display['display_options']['block_description'] = t('Activity stream');
    }
    if ($display_name === 'block_stream_homepage_without_post') {
      $display['display_options']['block_description'] = t('Activity stream - Without Post block');
    }
  }
  $view
    ->set('display', $displays);
  $view
    ->save(TRUE);
}