Skip to content
Snippets Groups Projects
Commit faf98417 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #1078980 by plach: language neutral not available when there are disabled languages.

parent 6cb0a702
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -133,7 +133,7 @@ function translation_form_node_form_alter(&$form, &$form_state) { ...@@ -133,7 +133,7 @@ function translation_form_node_form_alter(&$form, &$form_state) {
// might need to distinguish between enabled and disabled languages, hence // might need to distinguish between enabled and disabled languages, hence
// we divide them in two option groups. // we divide them in two option groups.
if ($translator_widget) { if ($translator_widget) {
$options = array(); $options = array($groups[1] => array(LANGUAGE_NONE => t('Language neutral')));
$language_list = locale_language_list('name', TRUE); $language_list = locale_language_list('name', TRUE);
foreach (array(1, 0) as $status) { foreach (array(1, 0) as $status) {
$group = $groups[$status]; $group = $groups[$status];
......
...@@ -125,6 +125,13 @@ class TranslationTestCase extends DrupalWebTestCase { ...@@ -125,6 +125,13 @@ class TranslationTestCase extends DrupalWebTestCase {
$translation_it = $this->createTranslation($node, $this->randomName(), $this->randomName(), 'it'); $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['it'][0]['value'], t('Content created in Italian (disabled).'));
// Confirm that language neutral is an option for translators when there are
// disabled languages.
$this->drupalGet('node/add/page');
$this->assertFieldByXPath('//select[@name="language"]//option', LANGUAGE_NONE, t('Language neutral is available in language selection with disabled languages.'));
$node2 = $this->createPage($this->randomName(), $this->randomName(), LANGUAGE_NONE);
$this->assertRaw($node2->body[LANGUAGE_NONE][0]['value'], t('Language neutral content created with disabled languages available.'));
// Leave just one language enabled and check that the translation overview // Leave just one language enabled and check that the translation overview
// page is still accessible. // page is still accessible.
$this->drupalLogin($this->admin_user); $this->drupalLogin($this->admin_user);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment