function social_book_update_8901 in Open Social 10.0.x
Same name and namespace in other branches
- 10.3.x modules/social_features/social_book/social_book.install \social_book_update_8901()
- 10.1.x modules/social_features/social_book/social_book.install \social_book_update_8901()
- 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 209 - 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);
}
}
}