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

dave reid’s picture

Status: Active » Needs review
StatusFileSize
new1.93 KB
boombatower’s picture

Status: Needs review » Reviewed & tested by the community

Looks good.

dave reid’s picture

StatusFileSize
new2.31 KB

Had 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.

dave reid’s picture

StatusFileSize
new2.3 KB

Extra newline in the last patch this one is ready to go and fully tested as per #3.

gábor hojtsy’s picture

Where was this added to Drupal 7?

dave reid’s picture

gábor hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Great, thanks. Fixed a minor coding style issue in the hook_node_type() (whitespace), and committed to Drupal 6.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.