diff --git a/modules/locale/locale.install b/modules/locale/locale.install index d671ebebe8f3303e4838c0ba0b3af851ace9843c..51b374f79e09b4a63b335c0c4f755a76ccd24fd0 100644 --- a/modules/locale/locale.install +++ b/modules/locale/locale.install @@ -164,7 +164,7 @@ function locale_update_6004() { /** * Change language setting variable of content types. - * + * * Use language_content_type_<content_type> instead of language_<content_type> * so content types such as 'default', 'count' or 'negotiation' will not * interfere with language variables. @@ -217,6 +217,26 @@ function locale_uninstall() { } } + // Clear variables. + variable_del('language_default'); + variable_del('language_count'); + variable_del('language_content_type_default'); + variable_del('language_content_type_negotiation'); + variable_del('locale_cache_strings'); + variable_del('locale_js_directory'); + variable_del('javascript_parsed'); + variable_del('language_negotiation'); + + foreach (node_get_types() as $type => $content_type) { + variable_del("language_content_type_$type"); + } + + // Switch back to English: with a $language->language value different from + // 'en' successive calls of t() might result in calling locale(), which in + // turn might try to query the unexisting {locales_source} and + // {locales_target} tables. + drupal_init_language(); + // Remove tables. drupal_uninstall_schema('locale'); } @@ -395,4 +415,3 @@ function locale_schema() { return $schema; } - diff --git a/modules/locale/locale.module b/modules/locale/locale.module index 0e32bacc54315483e44a1531917d8cd0f63db23a..54f0d36b9898ea9677cdab4d5f243939d51da6c7 100644 --- a/modules/locale/locale.module +++ b/modules/locale/locale.module @@ -301,6 +301,15 @@ function locale_theme() { ); } +/** + * Implementation of hook_node_type(). + */ +function locale_node_type($op, $info) { + if ($op == 'delete') { + variable_del('language_content_type_'. $info->type); + } +} + // --------------------------------------------------------------------------------- // Locale core functionality