1 node.install | node_update_1019() |
Update each content type with new node_preview configuration defaulted to enabled.
Related topics
File
- core/
modules/ node/ node.install, line 1891 - Install, update and uninstall functions for the node module.
Code
function node_update_1019() {
$types = config_get_names_with_prefix('node.type');
foreach ($types as $config_name) {
$config = config($config_name);
$settings = $config->get('settings');
if (!isset($settings['node_preview'])) {
$config->set('settings.node_preview', '1');
$config->save();
}
}
}