1 node.install node_update_1009()

Update the language setting for all node types.

Related topics

File

core/modules/node/node.install, line 1063
Install, update and uninstall functions for the node module.

Code

function node_update_1009() {
  $types = config_get_names_with_prefix('node.type');
  foreach ($types as $config_name) {
    $config = config($config_name);
    $language_setting = $config->get('settings.node_type_language');
    if (isset($language_setting)) {
      $config->set('settings.language', $language_setting);
      $config->clear('settings.node_type_language');
      $config->save();
    }
  }
}