Commit bac3ed77 authored by Dries's avatar Dries

- Patch #1539072 by Gábor Hojtsy: Fixed Support for disabled languages broken, drop it.

parent 4ef74ecd
...@@ -2549,43 +2549,32 @@ function language_multilingual() { ...@@ -2549,43 +2549,32 @@ function language_multilingual() {
/** /**
* Returns a list of configured languages. * Returns a list of configured languages.
* *
* @param $only_enabled
* (optional) Whether to return only enabled languages.
*
* @return * @return
* An associative array of languages, keyed by the language code, ordered by * An associative array of languages, keyed by the language code, ordered by
* weight ascending and name ascending. * weight ascending and name ascending.
*/ */
function language_list($only_enabled = FALSE) { function language_list() {
$languages = &drupal_static(__FUNCTION__); $languages = &drupal_static(__FUNCTION__);
// Initialize master language list. // Initialize master language list.
if (!isset($languages)) { if (!isset($languages)) {
// Initialize local language list caches.
$languages = array('all' => array(), 'enabled' => array());
// Fill in master language list based on current configuration.
$default = language_default(); $default = language_default();
if (language_multilingual() || module_exists('language')) { if (language_multilingual() || module_exists('language')) {
// Use language module configuration if available. // Use language module configuration if available.
$languages['all'] = db_query('SELECT * FROM {language} ORDER BY weight ASC, name ASC')->fetchAllAssoc('langcode'); $languages = db_query('SELECT * FROM {language} ORDER BY weight ASC, name ASC')->fetchAllAssoc('langcode');
} }
else { else {
// No language module, so use the default language only. // No language module, so use the default language only.
$languages['all'][$default->langcode] = $default; $languages = array($default->langcode => $default);
} }
// Initialize default property so callers have an easy reference and can // Initialize default property so callers have an easy reference and can
// save the same object without data loss. Also fill in the filtered list // save the same object without data loss.
// of enabled languages only. foreach ($languages as $langcode => $language) {
foreach ($languages['all'] as $langcode => $language) { $languages[$langcode]->default = ($langcode == $default->langcode);
$languages['all'][$langcode]->default = ($langcode == $default->langcode);
if ($language->enabled) {
$languages['enabled'][$langcode] = $languages['all'][$langcode];
}
} }
} }
return $only_enabled ? $languages['enabled'] : $languages['all']; return $languages;
} }
/** /**
...@@ -2636,7 +2625,6 @@ function language_default() { ...@@ -2636,7 +2625,6 @@ function language_default() {
'langcode' => 'en', 'langcode' => 'en',
'name' => 'English', 'name' => 'English',
'direction' => 0, 'direction' => 0,
'enabled' => 1,
'weight' => 0, 'weight' => 0,
)); ));
$default->default = TRUE; $default->default = TRUE;
......
...@@ -342,8 +342,7 @@ function language_negotiation_method_invoke($method_id, $method = NULL) { ...@@ -342,8 +342,7 @@ function language_negotiation_method_invoke($method_id, $method = NULL) {
if (!isset($results[$method_id])) { if (!isset($results[$method_id])) {
global $user; global $user;
// Get the enabled languages only. $languages = language_list();
$languages = language_list(TRUE);
if (!isset($method)) { if (!isset($method)) {
$negotiation_info = language_negotiation_info(); $negotiation_info = language_negotiation_info();
......
...@@ -184,20 +184,42 @@ function update_prepare_d8_language() { ...@@ -184,20 +184,42 @@ function update_prepare_d8_language() {
db_drop_field('languages', 'prefix'); db_drop_field('languages', 'prefix');
db_drop_field('languages', 'domain'); db_drop_field('languages', 'domain');
db_drop_field('languages', 'native'); db_drop_field('languages', 'native');
db_drop_field('languages', 'enabled');
// Update language count.
variable_set('language_count', db_query('SELECT COUNT(language) FROM {languages}')->fetchField());
// Rename the languages table to language. // Rename the languages table to language.
db_rename_table('languages', 'language'); db_rename_table('languages', 'language');
// Finally install/enable the language module. We need to use the update // Install/enable the language module. We need to use the update specific
// specific version of this function to ensure schema conflicts don't happen // version of this function to ensure schema conflicts don't happen due to
// due to our updated data. // our updated data.
$modules = array('language'); $modules = array('language');
update_module_add_to_system($modules); update_module_add_to_system($modules);
update_module_enable($modules); update_module_enable($modules);
// Rename 'language' column to 'langcode'. // Rename 'language' column to 'langcode'.
require_once DRUPAL_ROOT . '/core/modules/language/language.install'; db_drop_primary_key('language');
language_update_8000(); $langcode_spec = array(
'type' => 'varchar',
'length' => 12,
'not null' => TRUE,
'default' => '',
'description' => "Language code, e.g. 'de' or 'en-US'.",
);
db_change_field('language', 'language', 'langcode', $langcode_spec, array('primary key' => array('langcode')));
// Update the 'language_default' system variable with the langcode change.
$language_default = variable_get('language_default');
if (!empty($language_default)) {
if (isset($language_default->language)) {
$language_default->langcode = $language_default->language;
unset($language_default->language);
}
unset($language_default->enabled);
variable_set('language_default', $language_default);
}
} }
} }
......
...@@ -19,7 +19,6 @@ function language_admin_overview_form($form, &$form_state) { ...@@ -19,7 +19,6 @@ function language_admin_overview_form($form, &$form_state) {
'#tree' => TRUE, '#tree' => TRUE,
'#header' => array( '#header' => array(
t('Name'), t('Name'),
t('Enabled'),
t('Default'), t('Default'),
t('Weight'), t('Weight'),
t('Operations'), t('Operations'),
...@@ -32,13 +31,6 @@ function language_admin_overview_form($form, &$form_state) { ...@@ -32,13 +31,6 @@ function language_admin_overview_form($form, &$form_state) {
$form['languages'][$langcode]['name'] = array( $form['languages'][$langcode]['name'] = array(
'#markup' => check_plain($language->name), '#markup' => check_plain($language->name),
); );
$form['languages'][$langcode]['enabled'] = array(
'#type' => 'checkbox',
'#title' => t('Enable @title', array('@title' => $language->name)),
'#title_display' => 'invisible',
'#default_value' => (int) $language->enabled,
'#disabled' => $langcode == $default->langcode,
);
$form['languages'][$langcode]['default'] = array( $form['languages'][$langcode]['default'] = array(
'#type' => 'radio', '#type' => 'radio',
'#parents' => array('site_default'), '#parents' => array('site_default'),
...@@ -154,21 +146,6 @@ function language_admin_overview_form_submit($form, &$form_state) { ...@@ -154,21 +146,6 @@ function language_admin_overview_form_submit($form, &$form_state) {
foreach ($languages as $langcode => $language) { foreach ($languages as $langcode => $language) {
$language->default = ($form_state['values']['site_default'] == $langcode); $language->default = ($form_state['values']['site_default'] == $langcode);
$language->weight = $form_state['values']['languages'][$langcode]['weight']; $language->weight = $form_state['values']['languages'][$langcode]['weight'];
if ($language->default || $old_default->langcode == $langcode) {
// Automatically enable the default language and the language which was
// default previously (because we will not get the value from that
// disabled checkbox).
$form_state['values']['languages'][$langcode]['enabled'] = 1;
}
$language->enabled = (int) !empty($form_state['values']['languages'][$langcode]['enabled']);
// If the interface language has been disabled make sure that the form
// redirect includes the new default language as a query parameter.
if ($language->enabled == FALSE && $langcode == $GLOBALS['language_interface']->langcode) {
$form_state['redirect'] = array('admin/config/regional/language', array('language' => $languages[$form_state['values']['site_default']]));
}
language_save($language); language_save($language);
} }
...@@ -483,7 +460,6 @@ function language_negotiation_configure_form_table(&$form, $type) { ...@@ -483,7 +460,6 @@ function language_negotiation_configure_form_table(&$form, $type) {
'#language_negotiation_info' => array(), '#language_negotiation_info' => array(),
'#show_operations' => FALSE, '#show_operations' => FALSE,
'weight' => array('#tree' => TRUE), 'weight' => array('#tree' => TRUE),
'enabled' => array('#tree' => TRUE),
); );
$negotiation_info = $form['#language_negotiation_info']; $negotiation_info = $form['#language_negotiation_info'];
...@@ -694,8 +670,7 @@ function language_negotiation_configure_url_form($form, &$form_state) { ...@@ -694,8 +670,7 @@ function language_negotiation_configure_url_form($form, &$form_state) {
), ),
); );
// Get the enabled languages only. $languages = language_list();
$languages = language_list(TRUE);
$prefixes = language_negotiation_url_prefixes(); $prefixes = language_negotiation_url_prefixes();
$domains = language_negotiation_url_domains(); $domains = language_negotiation_url_domains();
foreach ($languages as $langcode => $language) { foreach ($languages as $langcode => $language) {
...@@ -731,8 +706,7 @@ function language_negotiation_configure_url_form($form, &$form_state) { ...@@ -731,8 +706,7 @@ function language_negotiation_configure_url_form($form, &$form_state) {
* the prefix and domain are only blank for the default. * the prefix and domain are only blank for the default.
*/ */
function language_negotiation_configure_url_form_validate($form, &$form_state) { function language_negotiation_configure_url_form_validate($form, &$form_state) {
// Get the enabled languages only. $languages = language_list();
$languages = language_list(TRUE);
// Count repeated values for uniqueness check. // Count repeated values for uniqueness check.
$count = array_count_values($form_state['values']['prefix']); $count = array_count_values($form_state['values']['prefix']);
......
...@@ -76,12 +76,6 @@ function language_schema() { ...@@ -76,12 +76,6 @@ function language_schema() {
'default' => 0, 'default' => 0,
'description' => 'Direction of language (Left-to-Right = 0, Right-to-Left = 1).', 'description' => 'Direction of language (Left-to-Right = 0, Right-to-Left = 1).',
), ),
'enabled' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => 'Enabled flag (1 = Enabled, 0 = Disabled).',
),
'weight' => array( 'weight' => array(
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
...@@ -96,31 +90,3 @@ function language_schema() { ...@@ -96,31 +90,3 @@ function language_schema() {
); );
return $schema; return $schema;
} }
/**
* Rename {language}.language to {language}.langcode.
*
* @see update_prepare_d8_language()
*/
function language_update_8000() {
// Rename language column to langcode and set it again as the primary key.
if (db_field_exists('language', 'language')) {
db_drop_primary_key('language');
$langcode_spec = array(
'type' => 'varchar',
'length' => 12,
'not null' => TRUE,
'default' => '',
'description' => "Language code, e.g. 'de' or 'en-US'.",
);
db_change_field('language', 'language', 'langcode', $langcode_spec, array('primary key' => array('langcode')));
}
// Update the 'language_default' system variable, if configured.
$language_default = variable_get('language_default');
if (!empty($language_default) && isset($language_default->language)) {
$language_default->langcode = $language_default->language;
unset($language_default->language);
variable_set('language_default', $language_default);
}
}
...@@ -165,10 +165,6 @@ function language_save($language) { ...@@ -165,10 +165,6 @@ function language_save($language) {
$language->direction = isset($predefined[$language->langcode][2]) ? $predefined[$language->langcode][2] : LANGUAGE_LTR; $language->direction = isset($predefined[$language->langcode][2]) ? $predefined[$language->langcode][2] : LANGUAGE_LTR;
} }
// Set to enabled for the default language and unless specified otherwise.
if (!empty($language->default) || !isset($language->enabled)) {
$language->enabled = TRUE;
}
// Let other modules modify $language before saved. // Let other modules modify $language before saved.
module_invoke_all('language_presave', $language); module_invoke_all('language_presave', $language);
...@@ -192,7 +188,7 @@ function language_save($language) { ...@@ -192,7 +188,7 @@ function language_save($language) {
} }
// Update language count based on enabled language count. // Update language count based on enabled language count.
variable_set('language_count', db_query('SELECT COUNT(langcode) FROM {language} WHERE enabled = 1')->fetchField()); variable_set('language_count', db_query('SELECT COUNT(langcode) FROM {language}')->fetchField());
// Kill the static cache in language_list(). // Kill the static cache in language_list().
drupal_static_reset('language_list'); drupal_static_reset('language_list');
...@@ -220,9 +216,7 @@ function language_delete($langcode) { ...@@ -220,9 +216,7 @@ function language_delete($langcode) {
->condition('langcode', $language->langcode) ->condition('langcode', $language->langcode)
->execute(); ->execute();
if ($language->enabled) { variable_set('language_count', variable_get('language_count', 1) - 1);
variable_set('language_count', variable_get('language_count', 1) - 1);
}
drupal_static_reset('language_list'); drupal_static_reset('language_list');
......
...@@ -293,8 +293,7 @@ function language_url_fallback($language = NULL, $language_type = LANGUAGE_TYPE_ ...@@ -293,8 +293,7 @@ function language_url_fallback($language = NULL, $language_type = LANGUAGE_TYPE_
* Translation links may be provided by other modules. * Translation links may be provided by other modules.
*/ */
function language_switcher_url($type, $path) { function language_switcher_url($type, $path) {
// Get the enabled languages only. $languages = language_list();
$languages = language_list(TRUE);
$links = array(); $links = array();
foreach ($languages as $language) { foreach ($languages as $language) {
...@@ -316,8 +315,7 @@ function language_switcher_session($type, $path) { ...@@ -316,8 +315,7 @@ function language_switcher_session($type, $path) {
$param = variable_get('language_negotiation_session_param', 'language'); $param = variable_get('language_negotiation_session_param', 'language');
$language_query = isset($_SESSION[$param]) ? $_SESSION[$param] : $GLOBALS[$type]->langcode; $language_query = isset($_SESSION[$param]) ? $_SESSION[$param] : $GLOBALS[$type]->langcode;
// Get the enabled languages only. $languages = language_list();
$languages = language_list(TRUE);
$links = array(); $links = array();
$query = $_GET; $query = $_GET;
...@@ -353,8 +351,7 @@ function language_url_rewrite_url(&$path, &$options) { ...@@ -353,8 +351,7 @@ function language_url_rewrite_url(&$path, &$options) {
$languages = &$drupal_static_fast['languages']; $languages = &$drupal_static_fast['languages'];
if (!isset($languages)) { if (!isset($languages)) {
// Get the enabled languages only. $languages = language_list();
$languages = language_list(TRUE);
$languages = array_flip(array_keys($languages)); $languages = array_flip(array_keys($languages));
} }
...@@ -439,8 +436,7 @@ function language_url_rewrite_session(&$path, &$options) { ...@@ -439,8 +436,7 @@ function language_url_rewrite_session(&$path, &$options) {
if (!isset($query_rewrite)) { if (!isset($query_rewrite)) {
global $user; global $user;
if (!$user->uid) { if (!$user->uid) {
// Get the enabled languages only. $languages = language_list();
$languages = language_list(TRUE);
$query_param = check_plain(variable_get('language_negotiation_session_param', 'language')); $query_param = check_plain(variable_get('language_negotiation_session_param', 'language'));
$query_value = isset($_GET[$query_param]) ? check_plain($_GET[$query_param]) : NULL; $query_value = isset($_GET[$query_param]) ? check_plain($_GET[$query_param]) : NULL;
$query_rewrite = isset($languages[$query_value]) && language_negotiation_method_enabled(LANGUAGE_NEGOTIATION_SESSION); $query_rewrite = isset($languages[$query_value]) && language_negotiation_method_enabled(LANGUAGE_NEGOTIATION_SESSION);
......
...@@ -74,20 +74,6 @@ class LanguageListTest extends DrupalWebTestCase { ...@@ -74,20 +74,6 @@ class LanguageListTest extends DrupalWebTestCase {
$this->assertEqual($this->getUrl(), url('admin/config/regional/language', array('absolute' => TRUE)), t('Correct page redirection.')); $this->assertEqual($this->getUrl(), url('admin/config/regional/language', array('absolute' => TRUE)), t('Correct page redirection.'));
$this->assertText(t('The default language cannot be deleted.'), t('Failed to delete the default language.')); $this->assertText(t('The default language cannot be deleted.'), t('Failed to delete the default language.'));
// Check if we can disable a language.
$edit = array(
'languages[en][enabled]' => FALSE,
);
$this->drupalPost(NULL, $edit, t('Save configuration'));
$this->assertNoFieldChecked('edit-languages-en-enabled', t('Language disabled.'));
// Set disabled language to be the default and ensure it is re-enabled.
$edit = array(
'site_default' => 'en',
);
$this->drupalPost(NULL, $edit, t('Save configuration'));
$this->assertFieldChecked('edit-languages-en-enabled', t('Default language re-enabled.'));
// Ensure 'edit' link works. // Ensure 'edit' link works.
$this->clickLink(t('edit')); $this->clickLink(t('edit'));
$this->assertTitle(t('Edit language | Drupal'), t('Page title is "Edit language".')); $this->assertTitle(t('Edit language | Drupal'), t('Page title is "Edit language".'));
...@@ -100,11 +86,16 @@ class LanguageListTest extends DrupalWebTestCase { ...@@ -100,11 +86,16 @@ class LanguageListTest extends DrupalWebTestCase {
$this->assertRaw($name, t('The language has been updated.')); $this->assertRaw($name, t('The language has been updated.'));
$this->assertEqual($this->getUrl(), url('admin/config/regional/language', array('absolute' => TRUE)), t('Correct page redirection.')); $this->assertEqual($this->getUrl(), url('admin/config/regional/language', array('absolute' => TRUE)), t('Correct page redirection.'));
// Change back the default language.
$edit = array(
'site_default' => 'en',
);
$this->drupalPost(NULL, $edit, t('Save configuration'));
// Ensure 'delete' link works. // Ensure 'delete' link works.
$this->drupalGet('admin/config/regional/language'); $this->drupalGet('admin/config/regional/language');
$this->clickLink(t('delete')); $this->clickLink(t('delete'));
$this->assertText(t('Are you sure you want to delete the language'), t('"delete" link is correct.')); $this->assertText(t('Are you sure you want to delete the language'), t('"delete" link is correct.'));
// Delete an enabled language. // Delete a language.
$this->drupalGet('admin/config/regional/language/delete/' . $langcode); $this->drupalGet('admin/config/regional/language/delete/' . $langcode);
// First test the 'cancel' link. // First test the 'cancel' link.
$this->clickLink(t('Cancel')); $this->clickLink(t('Cancel'));
...@@ -122,20 +113,13 @@ class LanguageListTest extends DrupalWebTestCase { ...@@ -122,20 +113,13 @@ class LanguageListTest extends DrupalWebTestCase {
$this->assertResponse(404, t('Language no longer found.')); $this->assertResponse(404, t('Language no longer found.'));
// Make sure the "language_count" variable has been updated correctly. // Make sure the "language_count" variable has been updated correctly.
drupal_static_reset('language_list'); drupal_static_reset('language_list');
$enabled_languages = language_list(TRUE); $languages = language_list();
$this->assertEqual(variable_get('language_count', 1), count($enabled_languages), t('Language count is correct.')); $this->assertEqual(variable_get('language_count', 1), count($languages), t('Language count is correct.'));
// Delete a disabled language. // Delete French.
// Disable an enabled language.
$edit = array(
'languages[fr][enabled]' => FALSE,
);
$this->drupalPost($path, $edit, t('Save configuration'));
$this->assertNoFieldChecked('edit-languages-fr-enabled', t('French language disabled.'));
// Get the count of enabled languages.
drupal_static_reset('language_list');
$enabled_languages = language_list(TRUE);
// Delete the disabled language.
$this->drupalPost('admin/config/regional/language/delete/fr', array(), t('Delete')); $this->drupalPost('admin/config/regional/language/delete/fr', array(), t('Delete'));
// Get the count of languages.
drupal_static_reset('language_list');
$languages = language_list();
// We need raw here because %language and %langcode will add HTML. // We need raw here because %language and %langcode will add HTML.
$t_args = array('%language' => 'French', '%langcode' => 'fr'); $t_args = array('%language' => 'French', '%langcode' => 'fr');
$this->assertRaw(t('The %language (%langcode) language has been removed.', $t_args), t('Disabled language has been removed.')); $this->assertRaw(t('The %language (%langcode) language has been removed.', $t_args), t('Disabled language has been removed.'));
...@@ -144,7 +128,7 @@ class LanguageListTest extends DrupalWebTestCase { ...@@ -144,7 +128,7 @@ class LanguageListTest extends DrupalWebTestCase {
$this->drupalGet('admin/config/regional/language/delete/fr'); $this->drupalGet('admin/config/regional/language/delete/fr');
$this->assertResponse(404, t('Language no longer found.')); $this->assertResponse(404, t('Language no longer found.'));
// Make sure the "language_count" variable has not changed. // Make sure the "language_count" variable has not changed.
$this->assertEqual(variable_get('language_count', 1), count($enabled_languages), t('Language count is correct.')); $this->assertEqual(variable_get('language_count', 1), count($languages), t('Language count is correct.'));
// Ensure we can delete the English language. Right now English is the only // Ensure we can delete the English language. Right now English is the only
// language so we must add a new language and make it the default before // language so we must add a new language and make it the default before
...@@ -245,7 +229,6 @@ class LanguageDependencyInjectionTest extends DrupalWebTestCase { ...@@ -245,7 +229,6 @@ class LanguageDependencyInjectionTest extends DrupalWebTestCase {
'langcode' => 'fr', 'langcode' => 'fr',
'name' => 'French', 'name' => 'French',
'direction' => 0, 'direction' => 0,
'enabled' => 1,
'weight' => 0, 'weight' => 0,
'default' => TRUE, 'default' => TRUE,
); );
......
...@@ -45,9 +45,7 @@ function locale_date_format_language_overview_page() { ...@@ -45,9 +45,7 @@ function locale_date_format_language_overview_page() {
array('data' => t('Operations'), 'colspan' => '2'), array('data' => t('Operations'), 'colspan' => '2'),
); );
// Get the enabled languages only. $languages = language_list();
$languages = language_list(TRUE);
foreach ($languages as $langcode => $language) { foreach ($languages as $langcode => $language) {
$row = array(); $row = array();
$row[] = $language->name; $row[] = $language->name;
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
*/ */
function locale_translate_import_form($form, &$form_state) { function locale_translate_import_form($form, &$form_state) {
drupal_static_reset('language_list'); drupal_static_reset('language_list');
$languages = language_list(TRUE); $languages = language_list();
// Initialize a language list to the ones available, including English if we // Initialize a language list to the ones available, including English if we
// are to translate Drupal to English as well. // are to translate Drupal to English as well.
...@@ -127,7 +127,7 @@ function locale_translate_import_form_submit($form, &$form_state) { ...@@ -127,7 +127,7 @@ function locale_translate_import_form_submit($form, &$form_state) {
* Builds form to export Gettext translation files. * Builds form to export Gettext translation files.
*/ */
function locale_translate_export_form($form, &$form_state) { function locale_translate_export_form($form, &$form_state) {
$languages = language_list(TRUE); $languages = language_list();
$language_options = array(); $language_options = array();
foreach ($languages as $langcode => $language) { foreach ($languages as $langcode => $language) {
if ($langcode != 'en' || locale_translate_english()) { if ($langcode != 'en' || locale_translate_english()) {
......
...@@ -156,7 +156,7 @@ function locale_translation_filters() { ...@@ -156,7 +156,7 @@ function locale_translation_filters() {
// Get all languages, except English // Get all languages, except English
drupal_static_reset('language_list'); drupal_static_reset('language_list');
$languages = language_list(TRUE); $languages = language_list();
$language_options = array(); $language_options = array();
foreach ($languages as $langcode => $language) { foreach ($languages as $langcode => $language) {
if ($langcode != 'en' || locale_translate_english()) { if ($langcode != 'en' || locale_translate_english()) {
......
...@@ -1930,24 +1930,6 @@ class LocaleUserLanguageFunctionalTest extends DrupalWebTestCase { ...@@ -1930,24 +1930,6 @@ class LocaleUserLanguageFunctionalTest extends DrupalWebTestCase {
'direction' => '0', 'direction' => '0',
); );
$this->drupalPost('admin/config/regional/language/add', $edit, t('Add custom language')); $this->drupalPost('admin/config/regional/language/add', $edit, t('Add custom language'));
// Add custom language and disable it.
// Code for the language.
$langcode_disabled = 'xx-yy';
// The English name for the language. This will be translated.
$name_disabled = $this->randomName(16);
$edit = array(
'predefined_langcode' => 'custom',
'langcode' => $langcode_disabled,
'name' => $name_disabled,
'direction' => '0',
);
$this->drupalPost('admin/config/regional/language/add', $edit, t('Add custom language'));
// Disable the language.
$edit = array(
'languages[' . $langcode_disabled . '][enabled]' => FALSE,
);
$this->drupalPost('admin/config/regional/language', $edit, t('Save configuration'));
$this->drupalLogout(); $this->drupalLogout();
// Login as normal user and edit account settings. // Login as normal user and edit account settings.
...@@ -1958,8 +1940,6 @@ class LocaleUserLanguageFunctionalTest extends DrupalWebTestCase { ...@@ -1958,8 +1940,6 @@ class LocaleUserLanguageFunctionalTest extends DrupalWebTestCase {
$this->assertText(t('Language'), t('Language selector available.')); $this->assertText(t('Language'), t('Language selector available.'));
// Ensure custom language is present. // Ensure custom language is present.
$this->assertText($name, t('Language present on form.')); $this->assertText($name, t('Language present on form.'));
// Ensure disabled language isn't present.
$this->assertNoText($name_disabled, t('Disabled language not present on form.'));