diff --git a/modules/field/modules/text/text.test b/modules/field/modules/text/text.test index b42fed7..5936937 100644 --- a/modules/field/modules/text/text.test +++ b/modules/field/modules/text/text.test @@ -464,7 +464,7 @@ class TextTranslationTestCase extends DrupalWebTestCase { $node = $this->drupalGetNodeByTitle($edit['title']); $this->drupalGet("node/$node->nid/translate"); $this->clickLink(t('add translation')); - $this->assertFieldByXPath("//textarea[@name='body[fr][0][value]']", $body, t('The textfield widget is populated.')); + $this->assertFieldByXPath("//textarea[@name='body[$langcode][0][value]']", $body, t('The textfield widget is populated.')); } /** @@ -484,17 +484,17 @@ class TextTranslationTestCase extends DrupalWebTestCase { ); // Create an article with the first body input format set to "Full HTML". - $langcode = 'en'; $title = $this->randomName(); $edit = array( 'title' => $title, - 'language' => $langcode, + 'language' => 'en', ); $this->drupalPost('node/add/article', $edit, t('Save')); // Populate the body field: the first item gets the "Full HTML" input // format, the second one "Filtered HTML". $formats = array('full_html', 'filtered_html'); + $langcode = LANGUAGE_NONE; foreach ($body as $delta => $value) { $edit = array( "body[$langcode][$delta][value]" => $value, diff --git a/modules/field_ui/field_ui.admin.inc b/modules/field_ui/field_ui.admin.inc index 96beb13..b594fac 100644 --- a/modules/field_ui/field_ui.admin.inc +++ b/modules/field_ui/field_ui.admin.inc @@ -509,6 +509,10 @@ function field_ui_field_overview_form($form, &$form_state, $entity_type, $bundle '#cell_attributes' => array('colspan' => 3), '#prefix' => '
 
', ), + 'translatable' => array( + '#type' => 'value', + '#value' => FALSE, + ), ); } @@ -753,7 +757,7 @@ function field_ui_field_overview_form_submit($form, &$form_state) { $field = array( 'field_name' => $values['field_name'], 'type' => $values['type'], - 'translatable' => TRUE, + 'translatable' => $values['translatable'], ); $instance = array( 'field_name' => $field['field_name'], diff --git a/modules/locale/locale.test b/modules/locale/locale.test index 42a6dbc..3ae6d91 100644 --- a/modules/locale/locale.test +++ b/modules/locale/locale.test @@ -2137,6 +2137,11 @@ class LocaleMultilingualFieldsFunctionalTest extends DrupalWebTestCase { ); $this->drupalPost('admin/structure/types/manage/page', $edit, t('Save content type')); $this->assertRaw(t('The content type %type has been updated.', array('%type' => 'Basic page')), t('Basic page content type has been updated.')); + + // Make node body translatable. + $field = field_info_field('body'); + $field['translatable'] = TRUE; + field_update_field($field); } /** diff --git a/modules/node/node.module b/modules/node/node.module index 20fc37e..613518a 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -558,7 +558,6 @@ function node_add_body_field($type, $label = 'Body') { 'field_name' => 'body', 'type' => 'text_with_summary', 'entity_types' => array('node'), - 'translatable' => TRUE, ); $field = field_create_field($field); } diff --git a/modules/path/path.test b/modules/path/path.test index 4112e5f..f42ec81 100644 --- a/modules/path/path.test +++ b/modules/path/path.test @@ -279,8 +279,9 @@ class PathLanguageTestCase extends DrupalWebTestCase { $this->drupalGet('node/' . $english_node->nid . '/translate'); $this->clickLink(t('add translation')); $edit = array(); + $langcode = LANGUAGE_NONE; $edit["title"] = $this->randomName(); - $edit["body[fr][0][value]"] = $this->randomName(); + $edit["body[$langcode][0][value]"] = $this->randomName(); $french_alias = $this->randomName(); $edit['path[alias]'] = $french_alias; $this->drupalPost(NULL, $edit, t('Save')); diff --git a/modules/translation/translation.test b/modules/translation/translation.test index 54b53d9..fe320a9 100644 --- a/modules/translation/translation.test +++ b/modules/translation/translation.test @@ -108,9 +108,9 @@ class TranslationTestCase extends DrupalWebTestCase { // Update original and mark translation as outdated. $node_body = $this->randomName(); - $node->body[$node->language][0]['value'] = $node_body; + $node->body[LANGUAGE_NONE][0]['value'] = $node_body; $edit = array(); - $edit["body[$node->language][0][value]"] = $node_body; + $edit["body[$langcode][0][value]"] = $node_body; $edit['translation[retranslate]'] = TRUE; $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save')); $this->assertRaw(t('Basic page %title has been updated.', array('%title' => $node_title)), t('Original node updated.')); @@ -121,7 +121,7 @@ class TranslationTestCase extends DrupalWebTestCase { // Update translation and mark as updated. $edit = array(); - $edit["body[$node_translation->language][0][value]"] = $this->randomName(); + $edit["body[$langcode][0][value]"] = $this->randomName(); $edit['translation[status]'] = FALSE; $this->drupalPost('node/' . $node_translation->nid . '/edit', $edit, t('Save')); $this->assertRaw(t('Basic page %title has been updated.', array('%title' => $node_translation_title)), t('Translated node updated.')); @@ -131,7 +131,7 @@ class TranslationTestCase extends DrupalWebTestCase { $this->drupalGet('node/add/page'); $this->assertFieldByXPath('//select[@name="language"]//option', 'it', t('Italian (disabled) is available in language selection.')); $translation_it = $this->createTranslation($node, $this->randomName(), $this->randomName(), 'it'); - $this->assertRaw($translation_it->body['it'][0]['value'], t('Content created in Italian (disabled).')); + $this->assertRaw($translation_it->body[LANGUAGE_NONE][0]['value'], t('Content created in Italian (disabled).')); // Confirm that language neutral is an option for translators when there are // disabled languages. @@ -349,9 +349,10 @@ class TranslationTestCase extends DrupalWebTestCase { function createTranslation($node, $title, $body, $language) { $this->drupalGet('node/add/page', array('query' => array('translation' => $node->nid, 'target' => $language))); - $body_key = "body[$language][0][value]"; + $langcode = LANGUAGE_NONE; + $body_key = "body[$langcode][0][value]"; $this->assertFieldByXPath('//input[@id="edit-title"]', $node->title, "Original title value correctly populated."); - $this->assertFieldByXPath("//textarea[@name='$body_key']", $node->body[$node->language][0]['value'], "Original body value correctly populated."); + $this->assertFieldByXPath("//textarea[@name='$body_key']", $node->body[LANGUAGE_NONE][0]['value'], "Original body value correctly populated."); $edit = array(); $edit["title"] = $title; diff --git a/profiles/standard/standard.install b/profiles/standard/standard.install index 7082906..5d44717 100644 --- a/profiles/standard/standard.install +++ b/profiles/standard/standard.install @@ -327,7 +327,6 @@ function standard_install() { 'field_name' => 'field_image', 'type' => 'image', 'cardinality' => 1, - 'translatable' => TRUE, 'locked' => FALSE, 'indexes' => array('fid' => array('fid')), 'settings' => array(