diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-04-28 05:14:33 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-04-28 05:14:33 +0000 |
commit | 7f58309f21e3f857a4681eea9fdc1ae517d6ddc7 (patch) | |
tree | e1a89f463bcffe0b5b1aec7fc927a10b5cb896e5 /modules | |
parent | e8df1cd6911b8f5a75e67a731fcb44b36581b8b4 (diff) | |
download | brdo-7f58309f21e3f857a4681eea9fdc1ae517d6ddc7.tar.gz brdo-7f58309f21e3f857a4681eea9fdc1ae517d6ddc7.tar.bz2 |
#782846 by plach: Fixed Body field language is not properly set during the upgrade path.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/node/node.install | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/modules/node/node.install b/modules/node/node.install index 3a139e981..ba07c5c39 100644 --- a/modules/node/node.install +++ b/modules/node/node.install @@ -536,7 +536,7 @@ function node_update_7006(&$context) { $query->innerJoin('node', 'n', 'n.vid = nr.vid'); $query ->fields('nr', array('nid', 'vid', 'body', 'teaser', 'format')) - ->fields('n', array('type', 'status', 'comment', 'promote', 'sticky')) + ->fields('n', array('type', 'status', 'comment', 'promote', 'sticky', 'language')) ->condition('nr.vid', $context['last'], '>') ->orderBy('nr.vid', 'ASC') ->range(0, $batch_size); @@ -558,20 +558,24 @@ function node_update_7006(&$context) { 'vid' => $revision->vid, 'type' => $revision->type, ); + // After node_update_7009() we will always have LANGUAGE_NONE as + // language neutral language code, but here we still have empty + // strings. + $langcode = empty($revision->language) ? LANGUAGE_NONE : $revision->language; if (!empty($revision->teaser) && $revision->teaser != text_summary($revision->body)) { - $node->body[LANGUAGE_NONE][0]['summary'] = $revision->teaser; + $node->body[$langcode][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[LANGUAGE_NONE][0]['value'] = $revision->body; + $node->body[$langcode][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[LANGUAGE_NONE][0]['format'] = !empty($revision->format) ? $revision->format : variable_get('filter_default_format', 1); + $node->body[$langcode][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($body_field_id)); |