1,13d0 < diff --git a/core/modules/entity/lib/Drupal/entity/Tests/EntityTranslationFormTest.php b/core/modules/entity/lib/Drupal/entity/Tests/EntityTranslationFormTest.php < index 3908184..69ef144 100644 < --- a/core/modules/entity/lib/Drupal/entity/Tests/EntityTranslationFormTest.php < +++ b/core/modules/entity/lib/Drupal/entity/Tests/EntityTranslationFormTest.php < @@ -86,7 +86,7 @@ class EntityTranslationFormTest extends WebTestBase { < < // Enable language selector. < $this->drupalGet('admin/structure/types/manage/page'); < - $edit = array('node_type_language_hidden' => FALSE, 'node_type_language_default' => LANGUAGE_NOT_SPECIFIED); < + $edit = array('language_configuration[language_hidden]' => FALSE, 'language_configuration[langcode]' => LANGUAGE_NOT_SPECIFIED); < $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.')); < 28c15 < index 5b62382..d9bd7d4 100644 --- > index 5b62382..42b4c1a 100644 31,39c18,27 < @@ -206,7 +206,6 @@ function language_element_info_alter(&$type) { < * < * @param array $element < * The form element to process. < - * < * @return array $element < * The processed form element. < */ < @@ -223,6 +222,207 @@ function language_process_language_select($element) { --- > @@ -216,6 +216,8 @@ function language_process_language_select($element) { > if (!isset($element['#options'])) { > $element['#options'] = array(); > foreach (language_list($element['#languages']) as $langcode => $language) { > + // @todo: http://drupal.org/node/1739928#comment-6471438 > + // Is this flipped? If it's locked, put it in t() so it can be translated? > $element['#options'][$langcode] = $language->locked ? t('- @name -', array('@name' => $language->name)) : $language->name; > } > } > @@ -223,6 +225,214 @@ function language_process_language_select($element) { 141c129 < +function language_save_default_configuration($entity_type, $bundle, $values = array()) { --- > +function language_save_default_configuration($entity_type, $bundle, $values = array()) { 151a140 > + * 157a147 > + // @todo: http://drupal.org/node/1783346 for unresolved CMI issue. 187a178 > + * 191a183,186 > + // @todo: http://drupal.org/node/1739928#comment-6471438 > + // Since these values are more or less coming in directly from > + // $form_state['values'], should there be some sanitization here to ensure > + // people aren't putting nonsense like "../../../../" in there? 201a197 > + * 204d199 < + * 238,239c233,234 < + // If we still not have a default value, just return the value stored in the < + // configuration, it has to be an actual language code. --- > + // If we still do not have a default value, just return the value stored in > + // the configuration; it has to be an actual language code. 246a242,249 > @@ -282,6 +492,7 @@ function language_update_count() { > * > * @param $langcode > * Language code of the language to be deleted. > + * > * @return > * TRUE if language is successfully deleted. Otherwise FALSE. > */ 249c252 < index 0000000..91ec9ce --- > index 0000000..3747c86 252c255 < @@ -0,0 +1,105 @@ --- > @@ -0,0 +1,111 @@ 284a288,290 > + /** > + * Tests the language settings have been saved. > + */ 290a297 > + 303a311 > + 323a332 > + 480c489 < index 355a022..b5dc922 100644 --- > index 355a022..c107020 100644 503c512 < @@ -205,18 +192,16 @@ function node_type_form($form, &$form_state, $type = NULL) { --- > @@ -205,18 +192,20 @@ function node_type_form($form, &$form_state, $type = NULL) { 517a527,530 > + > + // @todo: http://drupal.org/node/1739928#comment-6471438 > + // In taxonomy module, this was wrapped in an if (module_exists('language')) > + // check. Why is it not here? 531c544 < @@ -272,6 +257,7 @@ function node_type_form($form, &$form_state, $type = NULL) { --- > @@ -272,6 +261,7 @@ function node_type_form($form, &$form_state, $type = NULL) { 553c566 < index b27e1a6..b5c7da0 100644 --- > index 7924acc..fdc91d7 100644 603c616 < index 3ba3fe6..cecff40 100644 --- > index e191eca..c2407c2 100644 629c642 < @@ -80,7 +80,7 @@ class NodeTypeInitialLanguageTest extends NodeTestBase { --- > @@ -87,7 +87,7 @@ class NodeTypeInitialLanguageTest extends NodeTestBase { 678c691 < index 7add837..2fb3502 100644 --- > index bfba2fd..63cf36b 100644 681,682c694 < @@ -678,14 +678,17 @@ function node_field_extra_fields() { < --- > @@ -679,21 +679,16 @@ function node_field_extra_fields() { 685,688c697,710 < - // Visibility of the ordering of the language selector is the same as on the node/add form, < - // i.e. node_type_language_hidden_TYPE variable < - if ($module_language_enabled && !variable_get('node_type_language_hidden_' . $bundle->type, TRUE)) { < - $extra['node'][$bundle->type]['form']['language'] = array( --- > // Visibility of the ordering of the language selector is the same as on the > - // node/add form, i.e. node_type_language_hidden_TYPE variable. > + // node/add form. > if ($module_language_enabled) { > - if (!variable_get('node_type_language_hidden_' . $bundle->type, TRUE)) { > + $configuration = language_get_default_configuration('node', $bundle->type); > + if (!$configuration['language_hidden']) { > $extra['node'][$bundle->type]['form']['language'] = array( > 'label' => t('Language'), > 'description' => $description, > 'weight' => 0, > ); > } > - $extra['node'][$bundle->type]['display']['language'] = array( 691a714 > - 'visible' => FALSE, 693,703d715 < + // Visibility of the ordering of the language selector is the same as on the < + // node/add form. < + if ($module_language_enabled) { < + $configuration = language_get_default_configuration('node', $bundle->type); < + if (!$configuration['language_hidden']) { < + $extra['node'][$bundle->type]['form']['language'] = array( < + 'label' => t('Language'), < + 'description' => $description, < + 'weight' => 0, < + ); < + } 707c719 < @@ -693,47 +696,6 @@ function node_field_extra_fields() { --- > @@ -701,47 +696,6 @@ function node_field_extra_fields() { 811a824,836 > diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityTranslationFormTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityTranslationFormTest.php > index 2036d23..3ff533a 100644 > --- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityTranslationFormTest.php > +++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityTranslationFormTest.php > @@ -86,7 +86,7 @@ class EntityTranslationFormTest extends WebTestBase { > > // Enable language selector. > $this->drupalGet('admin/structure/types/manage/page'); > - $edit = array('node_type_language_hidden' => FALSE, 'node_type_language_default' => LANGUAGE_NOT_SPECIFIED); > + $edit = array('language_configuration[language_hidden]' => FALSE, 'language_configuration[langcode]' => LANGUAGE_NOT_SPECIFIED); > $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.')); > 813c838 < index dfa1c3f..0daca59 100644 --- > index c7ee415..77d0874 100644 916c941 < index f4368b7..db3ecc8 100644 --- > index f4368b7..f61b9e5 100644 931c956 < @@ -45,7 +43,9 @@ class VocabularyLanguageTest extends TaxonomyTestBase { --- > @@ -45,8 +43,14 @@ class VocabularyLanguageTest extends TaxonomyTestBase { 936a962,964 > + /** > + * Tests language settings for vocabularies. > + */ 938a967 > + 941c970,971 < @@ -70,4 +70,62 @@ class VocabularyLanguageTest extends TaxonomyTestBase { --- > > @@ -70,4 +74,67 @@ class VocabularyLanguageTest extends TaxonomyTestBase { 945a976,978 > + /** > + * Tests term language settings for vocabulary terms are saved and updated. > + */ 956a990 > + 995c1029,1030 < + // Check that the the old settings are empty. --- > + > + // Check that the old settings are empty. 1005c1040 < index 667041e..7fd02cf 100644 --- > index bdeea4c..450cd55 100644 1008c1043,1045 < @@ -46,10 +46,24 @@ class VocabularyFormController extends EntityFormController { --- > @@ -44,12 +44,31 @@ class VocabularyFormController extends EntityFormController { > '#title' => t('Description'), > '#default_value' => $vocabulary->description, 1009a1047,1051 > + > + // $form['langcode'] is not wrapped in an if (module_exists('language')) > + // check because the language_select form element works also without the > + // language module being installed. > + // http://drupal.org/node/1749954 documents the new element. 1034c1076 < @@ -72,6 +86,12 @@ class VocabularyFormController extends EntityFormController { --- > @@ -72,6 +91,12 @@ class VocabularyFormController extends EntityFormController { 1039c1081 < + // the submit buttons has custom submit handlers. --- > + // the submit button has custom submit handlers. 1047c1089 < @@ -100,6 +120,22 @@ class VocabularyFormController extends EntityFormController { --- > @@ -100,6 +125,22 @@ class VocabularyFormController extends EntityFormController { 1067c1109 < * Overrides Drupal\entity\EntityFormController::submit(). --- > * Overrides Drupal\Core\Entity\EntityFormController::submit().