You are here

function social_topic_update_8901 in Open Social 8.8

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_topic/social_topic.install \social_topic_update_8901()
  2. 10.3.x modules/social_features/social_topic/social_topic.install \social_topic_update_8901()
  3. 10.0.x modules/social_features/social_topic/social_topic.install \social_topic_update_8901()
  4. 10.1.x modules/social_features/social_topic/social_topic.install \social_topic_update_8901()
  5. 10.2.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 203
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);
    }
  }
}