You are here

function social_topic_update_8901 in Open Social 10.2.x

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

Update like setting in small teaser style.

File

modules/social_features/social_topic/social_topic.install, line 220
Install, update and uninstall functions for the social_topic module.

Code

function social_topic_update_8901() {
  $config_file = drupal_get_path('module', 'social_topic') . '/config/static/core.entity_view_display.node.topic.small_teaser_8901.yml';
  if (is_file($config_file)) {
    $settings = Yaml::parse(file_get_contents($config_file));
    if (is_array($settings)) {
      $config = \Drupal::configFactory()
        ->getEditable('core.entity_view_display.node.topic.small_teaser');
      $config
        ->setData($settings)
        ->save(TRUE);
    }
  }
}