You are here

function social_book_update_8901 in Open Social 10.1.x

Same name and namespace in other branches
  1. 10.3.x modules/social_features/social_book/social_book.install \social_book_update_8901()
  2. 10.0.x modules/social_features/social_book/social_book.install \social_book_update_8901()
  3. 10.2.x modules/social_features/social_book/social_book.install \social_book_update_8901()

Update Books to the new Config Form Open Social style.

File

modules/social_features/social_book/social_book.install, line 210
Install, update and uninstall functions for the social_book module.

Code

function social_book_update_8901() {
  $config_file = drupal_get_path('module', 'social_book') . '/config/static/social_book_static_update_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_form_display.node.book.default');
      $config
        ->setData($settings)
        ->save(TRUE);
    }
  }
}