Index: modules/locale/locale.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/locale/locale.admin.inc,v retrieving revision 1.13 diff -u -p -r1.13 locale.admin.inc --- modules/locale/locale.admin.inc 11 May 2010 10:49:37 -0000 1.13 +++ modules/locale/locale.admin.inc 28 May 2010 23:04:27 -0000 @@ -519,7 +519,7 @@ function _locale_languages_configure_for ); $language_providers = $form['#language_providers']; - $enabled_providers = variable_get("locale_language_providers_enabled_$type", array()); + $enabled_providers = variable_get("language_negotiation_$type", array()); $providers_weight = variable_get("locale_language_providers_weight_$type", array()); // Add missing data to the providers lists. @@ -527,16 +527,13 @@ function _locale_languages_configure_for if (!isset($providers_weight[$id])) { $providers_weight[$id] = language_provider_weight($provider); } - if (!isset($enabled_providers[$id])) { - $enabled_providers[$id] = FALSE; - } } // Order providers list by weight. asort($providers_weight); foreach ($providers_weight as $id => $weight) { - $enabled = $enabled_providers[$id]; + $enabled = isset($enabled_providers[$id]); $provider = $language_providers[$id]; // List the provider only if the current type is defined in its 'types' key. @@ -665,7 +662,6 @@ function locale_languages_configure_form } language_negotiation_set($type, $negotiation); - variable_set("locale_language_providers_enabled_$type", $enabled_providers); variable_set("locale_language_providers_weight_$type", $providers_weight); } Index: modules/locale/locale.install =================================================================== RCS file: /cvs/drupal/drupal/modules/locale/locale.install,v retrieving revision 1.58 diff -u -p -r1.58 locale.install --- modules/locale/locale.install 1 May 2010 08:12:23 -0000 1.58 +++ modules/locale/locale.install 28 May 2010 23:45:40 -0000 @@ -56,6 +56,15 @@ function locale_update_7001() { // LANGUAGE_NEGOTIATION_PATH_DEFAULT. case 1: $negotiation = array(LOCALE_LANGUAGE_NEGOTIATION_URL); + // In Drupal 6 path prefixes are shown for the default language only when + // language negotiation is set to LANGUAGE_NEGOTIATION_PATH, while in + // Drupal 7 path prefixes are always shown if not empty. Hence we need to + // ensure that the default language has an empty prefix to avoid breaking + // the site URLs with a prefix that previously was missing. + db_update('languages') + ->fields(array('prefix' => '')) + ->condition('language', language_default()->language) + ->execute(); break; // LANGUAGE_NEGOTIATION_PATH. @@ -70,11 +79,23 @@ function locale_update_7001() { break; } - // Save new language negotiation options. + // Save the new language negotiation options. language_negotiation_set(LANGUAGE_TYPE_INTERFACE, array_flip($negotiation)); language_negotiation_set(LANGUAGE_TYPE_CONTENT, array(LOCALE_LANGUAGE_NEGOTIATION_INTERFACE => 0)); language_negotiation_set(LANGUAGE_TYPE_URL, array(LOCALE_LANGUAGE_NEGOTIATION_URL => 0)); + // Save admininstration UI settings. + $type = LANGUAGE_TYPE_INTERFACE; + $provider_weights = array_flip(array_keys(locale_language_negotiation_info())); + variable_set("locale_language_providers_weight_$type", $provider_weights); + + // Update language switcher block delta. + db_update('block') + ->fields(array('delta' => $type)) + ->condition('module', 'locale') + ->condition('delta', 0) + ->execute(); + // Unset the old language negotiation system variable. variable_del('language_negotiation'); @@ -124,7 +145,6 @@ function locale_uninstall() { foreach (language_types() as $type) { variable_del("language_negotiation_$type"); - variable_del("locale_language_providers_enabled_$type"); variable_del("locale_language_providers_weight_$type"); }