diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-12-02 19:26:23 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-12-02 19:26:23 +0000 |
commit | 0baad49d620d9988837287cb5942eea764d3ed6f (patch) | |
tree | 146072f69b433cb7922572ba2ac627a83987edd4 /modules/node/node.install | |
parent | ef4513651e210784ba84eb310cf919e26f668bed (diff) | |
download | brdo-0baad49d620d9988837287cb5942eea764d3ed6f.tar.gz brdo-0baad49d620d9988837287cb5942eea764d3ed6f.tar.bz2 |
- Patch #635094 by plach: unify 'language neutral' language codes.
Diffstat (limited to 'modules/node/node.install')
-rw-r--r-- | modules/node/node.install | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/modules/node/node.install b/modules/node/node.install index 272c1fbd3..31ad1b238 100644 --- a/modules/node/node.install +++ b/modules/node/node.install @@ -490,21 +490,21 @@ function node_update_7006(&$context) { 'vid' => $revision->vid, 'type' => $revision->type, ); - $node->title[FIELD_LANGUAGE_NONE][0]['value'] = $revision->title; + $node->title[LANGUAGE_NONE][0]['value'] = $revision->title; if (!empty($revision->teaser) && $revision->teaser != text_summary($revision->body)) { - $node->body[FIELD_LANGUAGE_NONE][0]['summary'] = $revision->teaser; + $node->body[LANGUAGE_NONE][0]['summary'] = $revision->teaser; } // Do this after text_summary() above. $break = '<!--break-->'; if (substr($revision->body, 0, strlen($break)) == $break) { $revision->body = substr($revision->body, strlen($break)); } - $node->body[FIELD_LANGUAGE_NONE][0]['value'] = $revision->body; + $node->body[LANGUAGE_NONE][0]['value'] = $revision->body; // Explicitly store the current default text format if the revision // did not have its own text format. Similar conversions for other // core modules are performed in filter_update_7005(), but we do this // one here since we are already migrating the data. - $node->body[FIELD_LANGUAGE_NONE][0]['format'] = !empty($revision->format) ? $revision->format : variable_get('filter_default_format', 1); + $node->body[LANGUAGE_NONE][0]['format'] = !empty($revision->format) ? $revision->format : variable_get('filter_default_format', 1); // This is a core update and no contrib modules are enabled yet, so // we can assume default field storage for a faster update. field_sql_storage_field_storage_write('node', $node, FIELD_STORAGE_INSERT, array()); @@ -566,6 +566,16 @@ function node_update_7008() { } /** + * Convert node languages from the empty string to LANGUAGE_NONE. + */ +function node_update_7009() { + db_update('node') + ->fields(array('language' => LANGUAGE_NONE)) + ->condition('language', '') + ->execute(); +} + +/** * @} End of "defgroup updates-6.x-to-7.x" * The next series of updates should start at 8000. */ |