diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-05-29 18:45:31 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-05-29 18:45:31 +0000 |
commit | 4e1d58feee1df94d0b64682fdb9225e0043e6c13 (patch) | |
tree | d252122e8afea8b56ecef1ed0074e2ac0b7b1b26 /modules/locale/locale.install | |
parent | 128a693466938a9a4120a5e12fe8b8f7882251ef (diff) | |
download | brdo-4e1d58feee1df94d0b64682fdb9225e0043e6c13.tar.gz brdo-4e1d58feee1df94d0b64682fdb9225e0043e6c13.tar.bz2 |
- Patch #812416 by plach: fixed broken upgrade path.
Diffstat (limited to 'modules/locale/locale.install')
-rw-r--r-- | modules/locale/locale.install | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/modules/locale/locale.install b/modules/locale/locale.install index 1bc877c47..6846c3471 100644 --- a/modules/locale/locale.install +++ b/modules/locale/locale.install @@ -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"); } |