Steps to reproduce:
1. Enable locale.module
2. Add another language besides the default English
3. Disable and uninstall locale.module
You'll get fatal errors due to the {languages} table not being found because in language_list() which is called from drupal_init_language/language_initialize in bootstrap will fail on this logic:
// Init language list
if (!isset($languages)) {
if (variable_get('language_count', 1) > 1 || module_exists('locale')) {
$result = db_query('SELECT * FROM {languages} ORDER BY weight ASC, name ASC');
while ($row = db_fetch_object($result)) {
$languages['language'][$row->language] = $row;
}
}
else {
// No locale module, so use the default language only.
$default = language_default();
$languages['language'][$default->language] = $default;
}
}
Because the language_count variable was never deleted, it still has a value of 2, and so tries to access a table that no longer exists. We need to backport the locale.module uninstall routine from D7.
Comments
Comment #1
dave reidComment #2
boombatower commentedLooks good.
Comment #3
dave reidHad a bunch of errors when I had a non-english language set as default, so this one has been tested on two situations with multiple languages added: english as default and french as default. Both situations resulted in a clean uninstall with no error messages.
Comment #4
dave reidExtra newline in the last patch this one is ready to go and fully tested as per #3.
Comment #5
gábor hojtsyWhere was this added to Drupal 7?
Comment #6
dave reid#347288: Locale uninstall hook broken
http://api.drupal.org/api/function/locale_uninstall/7
Comment #7
gábor hojtsyGreat, thanks. Fixed a minor coding style issue in the hook_node_type() (whitespace), and committed to Drupal 6.