diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index c43e725..4656dbb 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -1834,15 +1834,10 @@ function comment_form($form, &$form_state, Comment $comment) { } $form['node_type'] = array('#type' => 'value', '#value' => 'comment_node_' . $node->type); - // If a content type has multilingual support we set the comment to inherit the - // content language. Otherwise mark the comment as language neutral. - $comment_langcode = $comment->langcode; - if (($comment_langcode == LANGUAGE_NOT_SPECIFIED) && variable_get('node_type_language_' . $node->type, 0)) { - $comment_langcode = $language_content->langcode; - } + // Uses the language of the content as comment language. $form['langcode'] = array( '#type' => 'value', - '#value' => $comment_langcode, + '#value' => $language_content->langcode, ); // Only show the save button if comment previews are optional or if we are diff --git a/core/modules/field/modules/text/text.test b/core/modules/field/modules/text/text.test index 0dbaccc..3922394 100644 --- a/core/modules/field/modules/text/text.test +++ b/core/modules/field/modules/text/text.test @@ -438,7 +438,7 @@ class TextTranslationTestCase extends DrupalWebTestCase { $this->drupalPost('admin/config/regional/language/add', $edit, t('Add language')); // Set "Article" content type to use multilingual support with translation. - $edit = array('node_type_language' => TRANSLATION_ENABLED); + $edit = array('node_type_language_locked' => FALSE, 'node_type_language_translation_enabled' => TRANSLATION_ENABLED); $this->drupalPost('admin/structure/types/manage/article', $edit, t('Save content type')); $this->assertRaw(t('The content type %type has been updated.', array('%type' => 'Article')), t('Article content type has been updated.')); } diff --git a/core/modules/locale/locale.test b/core/modules/locale/locale.test index ded11ef..0287252 100644 --- a/core/modules/locale/locale.test +++ b/core/modules/locale/locale.test @@ -1588,7 +1588,7 @@ class LocaleUninstallFunctionalTest extends DrupalWebTestCase { $this->assertEqual($GLOBALS['language_interface']->langcode, $this->langcode, t('Current language: %lang', array('%lang' => $GLOBALS['language_interface']->langcode))); // Enable multilingual workflow option for articles. - variable_set('node_type_language_article', 1); + variable_set('node_type_language_locked_article', FALSE); // Change JavaScript translations directory. variable_set('locale_js_directory', 'js_translations'); @@ -2271,9 +2271,9 @@ class LocaleContentFunctionalTest extends DrupalWebTestCase { // Set "Basic page" content type to use multilingual support. $this->drupalGet('admin/structure/types/manage/page'); - $this->assertText(t('Multilingual support'), t('Multilingual support fieldset present on content type configuration form.')); + $this->assertText(t('Language settings'), t('Multilingual support fieldset present on content type configuration form.')); $edit = array( - 'node_type_language' => 1, + 'node_type_language_locked' => FALSE, ); $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.')); @@ -2298,7 +2298,7 @@ class LocaleContentFunctionalTest extends DrupalWebTestCase { $edit = array( 'type' => 'page', 'title' => $node_title, - 'body' => array($langcode => array(array('value' => $node_body))), + 'body' => array(LANGUAGE_NOT_SPECIFIED => array(array('value' => $node_body))), 'langcode' => $langcode, ); $node = $this->drupalCreateNode($edit); @@ -2341,7 +2341,7 @@ class LocaleContentFunctionalTest extends DrupalWebTestCase { // Set "Article" content type to use multilingual support. $this->drupalGet('admin/structure/types/manage/article'); $edit = array( - 'node_type_language' => 1, + 'node_type_language_locked' => FALSE, ); $this->drupalPost('admin/structure/types/manage/article', $edit, t('Save content type')); $this->assertRaw(t('The content type %type has been updated.', array('%type' => 'Article')), t('Article content type has been updated.')); @@ -2390,7 +2390,7 @@ class LocaleContentFunctionalTest extends DrupalWebTestCase { $edit = array( 'type' => 'article', 'title' => $node_title, - 'body' => array($langcode => array(array('value' => $node_body))), + 'body' => array(LANGUAGE_NOT_SPECIFIED => array(array('value' => $node_body))), 'langcode' => $langcode, 'promote' => 1, ); @@ -2822,7 +2822,7 @@ class LocaleMultilingualFieldsFunctionalTest extends DrupalWebTestCase { // Set "Basic page" content type to use multilingual support. $edit = array( - 'node_type_language' => 1, + 'node_type_language_locked' => FALSE, ); $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.')); @@ -2838,7 +2838,7 @@ class LocaleMultilingualFieldsFunctionalTest extends DrupalWebTestCase { */ function testMultilingualNodeForm() { // Create "Basic page" content. - $langcode = LANGUAGE_NOT_SPECIFIED; + $langcode = node_type_get_default_langcode('page'); $title_key = "title"; $title_value = $this->randomName(8); $body_key = "body[$langcode][0][value]"; @@ -2848,7 +2848,6 @@ class LocaleMultilingualFieldsFunctionalTest extends DrupalWebTestCase { $edit = array(); $edit[$title_key] = $title_value; $edit[$body_key] = $body_value; - $edit['langcode'] = 'en'; $this->drupalPost('node/add/page', $edit, t('Save')); // Check that the node exists in the database. @@ -2887,7 +2886,7 @@ class LocaleMultilingualFieldsFunctionalTest extends DrupalWebTestCase { */ function testMultilingualDisplaySettings() { // Create "Basic page" content. - $langcode = LANGUAGE_NOT_SPECIFIED; + $langcode = node_type_get_default_langcode('page'); $title_key = "title"; $title_value = $this->randomName(8); $body_key = "body[$langcode][0][value]"; @@ -2897,7 +2896,6 @@ class LocaleMultilingualFieldsFunctionalTest extends DrupalWebTestCase { $edit = array(); $edit[$title_key] = $title_value; $edit[$body_key] = $body_value; - $edit['langcode'] = 'en'; $this->drupalPost('node/add/page', $edit, t('Save')); // Check that the node exists in the database. @@ -2940,7 +2938,7 @@ class LocaleCommentLanguageFunctionalTest extends DrupalWebTestCase { $this->drupalPost('admin/config/regional/language/add', $edit, t('Add language')); // Set "Article" content type to use multilingual support. - $edit = array('node_type_language' => 1); + $edit = array('node_type_language_locked' => FALSE); $this->drupalPost('admin/structure/types/manage/article', $edit, t('Save content type')); // Enable content language negotiation UI. diff --git a/core/modules/node/content_types.inc b/core/modules/node/content_types.inc index 2e45c9a..d3338ee 100644 --- a/core/modules/node/content_types.inc +++ b/core/modules/node/content_types.inc @@ -186,11 +186,35 @@ function node_type_form($form, &$form_state, $type = NULL) { '#description' => t('Users with the Administer content permission will be able to override these options.'), ); if (module_exists('language')) { - $form['workflow']['node_type_language'] = array( + $languages = language_list(); + $lang_options = array( + LANGUAGE_NOT_SPECIFIED => t('- None -'), + 'site_default' => t("Site's default"), + 'current' => t('Current language'), + 'user_default' => t("User's default"), + ); + foreach ($languages as $langcode => $language) { + $lang_options[$langcode] = $language->name; + } + + $form['language'] = array( + '#type' => 'fieldset', + '#title' => t('Language settings'), + '#collapsible' => TRUE, + '#collapsed' => TRUE, + '#group' => 'additional_settings', + ); + $form['language']['node_type_language_default'] = array( + '#type' => 'select', + '#title' => t('Default language'), + '#options' => $lang_options, + '#default_value' => variable_get('node_type_language_default_' . $type->type, 'site_default'), + ); + $form['language']['node_type_language_locked'] = array( '#type' => 'checkbox', - '#title' => t('Multilingual support'), - '#default_value' => variable_get('node_type_language_' . $type->type, 0), - '#description' => t('Add a language selection field to the editing form, allowing you to select from one of the enabled languages. If disabled, new posts are saved with the default language. Existing content will not be affected by changing this option.', array('!languages' => url('admin/config/regional/language'))), + '#title' => t('Lock language'), + '#default_value' => variable_get('node_type_language_locked_' . $type->type, TRUE), + '#description' => t('Users will not be able to change the default language on content of this type.'), ); } $form['display'] = array( diff --git a/core/modules/node/content_types.js b/core/modules/node/content_types.js index 43cfa37..5e9ab75 100644 --- a/core/modules/node/content_types.js +++ b/core/modules/node/content_types.js @@ -19,6 +19,17 @@ Drupal.behaviors.contentTypes = { } return vals.join(', '); }); + $('fieldset#edit-language', context).drupalSetSummary(function(context) { + var vals = []; + + vals.push($(".form-item-node-type-language-default select option:selected", context).text()); + + $('input:checked', context).next('label').each(function() { + vals.push(Drupal.checkPlain($(this).text())); + }); + + return vals.join(', '); + }); $context.find('fieldset#edit-display').drupalSetSummary(function(context) { var vals = []; var $context = $(context); @@ -30,6 +41,15 @@ Drupal.behaviors.contentTypes = { } return vals.join(', '); }); + $('#edit-node-type-language-default, #edit-node-type-language-locked', context).change(function(context) { + if ($('#edit-node-type-language-default').val() == 'und' && $('#edit-node-type-language-locked').attr('checked')) { + $('#edit-node-type-language-translation-enabled').attr('disabled', true); + $('#edit-node-type-language-translation-enabled').removeAttr('checked'); + } else { + $('#edit-node-type-language-translation-enabled').removeAttr('disabled'); + } + }); + $('#edit-node-type-language-default', context).trigger('change'); } }; diff --git a/core/modules/node/node.install b/core/modules/node/node.install index b2616ab..65917e6 100644 --- a/core/modules/node/node.install +++ b/core/modules/node/node.install @@ -458,9 +458,12 @@ function node_uninstall() { ->condition('name', 'node_options_' . $type) ->condition('name', 'node_submitted_' . $type) ->condition('name', 'node_permissions_' . $type) - ->condition('name', 'node_type_language_' . $type) + ->condition('name', 'node_type_language_default_' . $type) + ->condition('name', 'node_type_language_locked_' . $type) ) ->execute(); + // TODO: node_type_language_translation_enabled_ in the translation module + // ->condition('name', 'node_type_language_translation_enabled_' . $type) } // Delete node search ranking variables. @@ -558,6 +561,24 @@ function node_update_8002() { } /** + * Rename node type language variable names. + */ +function node_update_8003() { + $types = db_query('SELECT type FROM {node_type}')->fetchCol(); + foreach ($types as $type) { + variable_set('node_type_language_default_' . $type, LANGUAGE_NOT_SPECIFIED); + $language = variable_get('node_type_language_' . $type, 0); + if ($language == 0) { + variable_set('node_type_language_locked_' . $type, TRUE); + } + if ($language == 2) { + variable_set('node_type_language_translation_enabled_' . $type, 2); + } + variable_del('node_type_language_' . $type); + } +} + +/** * @} End of "addtogroup updates-7.x-to-8.x" * The next series of updates should start at 9000. */ diff --git a/core/modules/node/node.module b/core/modules/node/node.module index 5e1c3b3..d8a6ee1 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -639,6 +639,47 @@ function node_field_extra_fields() { } /** + * Get the default language for a node type + * + * @param string $node_type + * The type of node + * + * @return (string) + * The language code of the node type's default langcode + */ +function node_type_get_default_langcode($node_type) { + $default_value = variable_get('node_type_language_default_' . $node_type, 'site_default'); + + if ($default_value == LANGUAGE_NOT_SPECIFIED) { + return LANGUAGE_NOT_SPECIFIED; + } + + switch ($default_value) { + case 'site_default': + $default_value = language_default()->langcode; + break; + + case 'current': + global $language_interface; + $default_value = $language_interface->langcode; + break; + + case 'user_default': + global $user; + if (!empty($user->preferred_langcode)) { + $default_value = $user->preferred_langcode; + } + else { + global $language_interface; + $default_value = $language_interface->langcode; + } + break; + } + + return $default_value; +} + +/** * Deletes a node type from the database. * * @param $type diff --git a/core/modules/node/node.pages.inc b/core/modules/node/node.pages.inc index 868acbd..c2af7d5 100644 --- a/core/modules/node/node.pages.inc +++ b/core/modules/node/node.pages.inc @@ -86,7 +86,7 @@ function node_add($type) { 'uid' => $user->uid, 'name' => (isset($user->name) ? $user->name : ''), 'type' => $type, - 'langcode' => LANGUAGE_NOT_SPECIFIED, + 'langcode' => node_type_get_default_langcode($type) )); drupal_set_title(t('Create @name', array('@name' => $types[$type]->name)), PASS_THROUGH); $output = drupal_get_form($type . '_node_form', $node); @@ -181,7 +181,7 @@ function node_form($form, &$form_state, Node $node) { // @todo D8: Remove. Modules should access the node using $form_state['node']. $form['#node'] = $node; - if (variable_get('node_type_language_' . $node->type, 0) && module_exists('language')) { + if (module_exists('language')) { $languages = language_list(); $language_options = array(); foreach ($languages as $langcode => $language) { @@ -193,14 +193,16 @@ function node_form($form, &$form_state, Node $node) { '#default_value' => (isset($node->langcode) ? $node->langcode : ''), '#options' => $language_options, '#empty_value' => LANGUAGE_NOT_SPECIFIED, + '#disabled' => variable_get('node_type_language_locked_' . $node->type, TRUE), ); } else { $form['langcode'] = array( '#type' => 'value', - // New nodes without multilingual support get the default language, old - // nodes keep their language if language.module is not available. - '#value' => !isset($form['#node']->nid) ? language_default()->langcode : $node->langcode, + // New nodes without multilingual support get the default language of the + // content type (for new nodes already set in node_add), old nodes keep + // their language if language.module is not available. + '#value' => $node->langcode, ); } diff --git a/core/modules/node/node.test b/core/modules/node/node.test index 655bc0b..0907f0a 100644 --- a/core/modules/node/node.test +++ b/core/modules/node/node.test @@ -1446,6 +1446,65 @@ class NodeTypeTestCase extends NodeWebTestCase { } /** + * Tests related to node type initial language. + */ +class NodeTypeInitalLanguageTestCase extends NodeWebTestCase { + public static function getInfo() { + return array( + 'name' => 'Node type initial language', + 'description' => 'Tests node type initial language settings.', + 'group' => 'Node', + ); + } + + function setUp() { + parent::setUp(array('language')); + $web_user = $this->drupalCreateUser(array('bypass node access', 'administer content types', 'administer languages')); + $this->drupalLogin($web_user); + } + + /** + * Tests the node type initial language defaults, and modify them. + * + * The default initial language must be the site's default, and the language + * locked option must be on. + */ + function testNodeTypeInitialLanguageDefaults() { + $this->drupalGet('admin/structure/types/manage/article'); + $this->assertOptionSelected('edit-node-type-language-default', 'site_default', 'The default inital language is the site default.'); + $this->assertFieldChecked('edit-node-type-language-locked', 'Language is locked by default.'); + + $this->drupalGet('node/add/article'); + $this->assertRaw('select disabled="disabled" id="edit-langcode"', 'Language is not selectable on node add/edit page when language is locked.'); + $this->assertOptionSelected('edit-langcode', language_default()->langcode, 'The inital language is the site default on the node add page.'); + + // Adds a new language and set it as default. + $edit = array( + 'predefined_langcode' => 'hu', + ); + $this->drupalPost('admin/config/regional/language/add', $edit, t('Add language')); + $edit = array( + 'site_default' => 'hu', + ); + $this->drupalPost('admin/config/regional/language', $edit, t('Save configuration')); + + // Tests the initial language after changing the site default language. + $this->drupalGet('node/add/article'); + $this->assertOptionSelected('edit-langcode', 'hu', 'The inital language is the site default on the node add page after the site default language is changed.'); + + // Changes the inital language settings. + $edit = array( + 'node_type_language_default' => 'en', + 'node_type_language_locked' => FALSE, + ); + $this->drupalPost('admin/structure/types/manage/article', $edit, t('Save content type')); + $this->drupalGet('node/add/article'); + $this->assertNoRaw('select disabled="disabled" id="edit-langcode"', "Language is selectable on node add/edit page when language isn't locked."); + $this->assertOptionSelected('edit-langcode', 'en', 'The inital language is the previously selected language on the node add page.'); + } +} + +/** * Test node type customizations persistence. */ class NodeTypePersistenceTestCase extends NodeWebTestCase { @@ -2289,8 +2348,8 @@ class NodeTokenReplaceTestCase extends NodeWebTestCase { $tests['[node:type]'] = 'article'; $tests['[node:type-name]'] = 'Article'; $tests['[node:title]'] = check_plain($node->title); - $tests['[node:body]'] = _text_sanitize($instance, $node->langcode, $node->body[$node->langcode][0], 'value'); - $tests['[node:summary]'] = _text_sanitize($instance, $node->langcode, $node->body[$node->langcode][0], 'summary'); + $tests['[node:body]'] = _text_sanitize($instance, $node->langcode, $node->body[LANGUAGE_NOT_SPECIFIED][0], 'value'); + $tests['[node:summary]'] = _text_sanitize($instance, $node->langcode, $node->body[LANGUAGE_NOT_SPECIFIED][0], 'summary'); $tests['[node:langcode]'] = check_plain($node->langcode); $tests['[node:url]'] = url('node/' . $node->nid, $url_options); $tests['[node:edit-url]'] = url('node/' . $node->nid . '/edit', $url_options); @@ -2310,8 +2369,8 @@ class NodeTokenReplaceTestCase extends NodeWebTestCase { // Generate and test unsanitized tokens. $tests['[node:title]'] = $node->title; - $tests['[node:body]'] = $node->body[$node->langcode][0]['value']; - $tests['[node:summary]'] = $node->body[$node->langcode][0]['summary']; + $tests['[node:body]'] = $node->body[LANGUAGE_NOT_SPECIFIED][0]['value']; + $tests['[node:summary]'] = $node->body[LANGUAGE_NOT_SPECIFIED][0]['summary']; $tests['[node:langcode]'] = $node->langcode; $tests['[node:author:name]'] = user_format_name($account); diff --git a/core/modules/path/path.test b/core/modules/path/path.test index a3f5820..a0bb91b 100644 --- a/core/modules/path/path.test +++ b/core/modules/path/path.test @@ -320,7 +320,8 @@ class PathLanguageTestCase extends PathTestCase { */ function testAliasTranslation() { // Set 'page' content type to enable translation. - variable_set('node_type_language_page', TRANSLATION_ENABLED); + variable_set('node_type_language_locked_page', FALSE); + variable_set('node_type_language_translation_enabled_page', TRANSLATION_ENABLED); $english_node = $this->drupalCreateNode(array('type' => 'page')); $english_alias = $this->randomName(); diff --git a/core/modules/poll/poll.test b/core/modules/poll/poll.test index cba67ba..d12a4ec 100644 --- a/core/modules/poll/poll.test +++ b/core/modules/poll/poll.test @@ -833,8 +833,7 @@ class PollTranslateTestCase extends PollWebTestCase { // Set "Poll" content type to use multilingual support with translation. $this->drupalGet('admin/structure/types/manage/poll'); - $edit = array(); - $edit['node_type_language'] = TRANSLATION_ENABLED; + $edit = array('node_type_language_locked' => FALSE, 'node_type_language_translation_enabled' => TRANSLATION_ENABLED); $this->drupalPost('admin/structure/types/manage/poll', $edit, t('Save content type')); $this->assertRaw(t('The content type %type has been updated.', array('%type' => 'Poll')), t('Poll content type has been updated.')); diff --git a/core/modules/simpletest/drupal_web_test_case.php b/core/modules/simpletest/drupal_web_test_case.php index 15c1656..55964ba 100644 --- a/core/modules/simpletest/drupal_web_test_case.php +++ b/core/modules/simpletest/drupal_web_test_case.php @@ -935,7 +935,7 @@ class DrupalWebTestCase extends DrupalTestCase { 'sticky' => 0, 'type' => 'page', 'revisions' => NULL, - 'langcode' => LANGUAGE_NOT_SPECIFIED, + 'langcode' => language_default()->langcode, ); // Use the original node's created time for existing nodes. @@ -960,7 +960,7 @@ class DrupalWebTestCase extends DrupalTestCase { 'value' => $this->randomName(32), 'format' => filter_default_format(), ); - $settings['body'][$settings['langcode']][0] += $body; + $settings['body'][LANGUAGE_NOT_SPECIFIED][0] += $body; $node = entity_create('node', $settings); $node->save(); diff --git a/core/modules/system/tests/upgrade/upgrade.language.test b/core/modules/system/tests/upgrade/upgrade.language.test index e473c63..cfdd732 100644 --- a/core/modules/system/tests/upgrade/upgrade.language.test +++ b/core/modules/system/tests/upgrade/upgrade.language.test @@ -77,7 +77,7 @@ class LanguageUpgradePathTestCase extends UpgradePathTestCase { $this->drupalGet('node/add/article'); $this->assertFieldByName('langcode'); $this->drupalGet('node/add/page'); - $this->assertNoFieldByName('langcode'); + $this->assertFieldByName('langcode'); // Check that the user language value was retained in both langcode and // preferred_langcode. diff --git a/core/modules/translation/translation.install b/core/modules/translation/translation.install new file mode 100644 index 0000000..0c15c8e --- /dev/null +++ b/core/modules/translation/translation.install @@ -0,0 +1,21 @@ +fetchCol(); + foreach ($types as $type) { + $translatable = variable_get('node_type_language_locked_' . $type, FALSE); + if ($translatable) { + variable_set('node_type_language_locked_' . $type, 0); + } + } +} diff --git a/core/modules/translation/translation.module b/core/modules/translation/translation.module index b2c0635..2b7f41d 100644 --- a/core/modules/translation/translation.module +++ b/core/modules/translation/translation.module @@ -120,10 +120,24 @@ function translation_permission() { */ function translation_form_node_type_form_alter(&$form, &$form_state) { // Add translation option to content type form. - $form['workflow']['node_type_language']['#type'] = 'radios'; - $form['workflow']['node_type_language']['#options'] = array(t('Disabled'), t('Enabled'), TRANSLATION_ENABLED => t('Enabled, with translation')); - // Description based on text from node.module. - $form['workflow']['node_type_language']['#description'] = t('Add a language selection field to the editing form, allowing you to select from one of the enabled languages. You can also turn on translation for this content type, which lets you have content translated to any of the installed languages. If disabled, new posts are saved with the default language. Existing content will not be affected by changing this option.', array('@languages' => url('admin/config/regional/language'))); + $form['language']['node_type_language_translation_enabled'] = array( + '#type' => 'checkbox', + '#title' => t('Enable translation'), + '#return_value' => TRANSLATION_ENABLED, + '#default_value' => variable_get('node_type_language_translation_enabled_' . $form['#node_type']->type, FALSE), + '#element_validate' => array('translation_node_type_language_translation_enabled_validate'), + '#prefix' => "", + ); +} + +/** + * Checks that translation is disabled when default language is none and + * default language is locked. + */ +function translation_node_type_language_translation_enabled_validate($element, &$form_state, $form){ + if ($form_state['values']['node_type_language_default'] == 'und' && $form_state['values']['node_type_language_locked'] && $form_state['values']['node_type_language_translation_enabled'] == TRANSLATION_ENABLED) { + form_set_error('node_type_language_translation_enabled', t('Translation cannot be enabled if no default language is None and locked.')); + } } /** @@ -461,7 +475,7 @@ function translation_node_get_translations($tnid) { * TRUE if translation is supported, and FALSE if not. */ function translation_supported_type($type) { - return variable_get('node_type_language_' . $type, 0) == TRANSLATION_ENABLED; + return variable_get('node_type_language_translation_enabled_' . $type, 0) == TRANSLATION_ENABLED; } /** diff --git a/core/modules/translation/translation.test b/core/modules/translation/translation.test index 15a324e..515b2bf 100644 --- a/core/modules/translation/translation.test +++ b/core/modules/translation/translation.test @@ -39,8 +39,7 @@ class TranslationTestCase extends DrupalWebTestCase { // Set "Basic page" content type to use multilingual support with // translation. $this->drupalGet('admin/structure/types/manage/page'); - $edit = array(); - $edit['node_type_language'] = TRANSLATION_ENABLED; + $edit = array('node_type_language_locked' => FALSE, 'node_type_language_translation_enabled' => TRANSLATION_ENABLED); $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.')); @@ -219,7 +218,7 @@ class TranslationTestCase extends DrupalWebTestCase { // Disable translation support to check that the language switcher is left // untouched only for new nodes. $this->drupalLogin($this->admin_user); - $edit = array('node_type_language' => 0); + $edit = array('node_type_language_locked' => TRUE, 'node_type_language_translation_enabled' => FALSE); $this->drupalPost('admin/structure/types/manage/page', $edit, t('Save content type')); $this->drupalLogin($this->translator);