When I install this module it creates taxonomies of its own (weather-local and weather-world) and gives all the terms a tid in auto_incremental way, including in the table taxonomy_term_hierarchy {tid, parent pair}.

I then decide to uninstall the module. After uninstalling the module when I go on to manually create a new taxonomy term (in one of my own vocabulary) I get the following error:

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '203-0' for key 'PRIMARY': INSERT INTO {taxonomy_term_hierarchy} (tid, parent) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1); Array ( [:db_insert_placeholder_0] => 203 [:db_insert_placeholder_1] => 0 ) in taxonomy_term_save() (line 679 of /data/disk/o1/static/my-platform-main-7.22.1-p001/modules/taxonomy/taxonomy.module).

The website encountered an unexpected error. Please try again later. 

The term does eventually get created and but the url alias for term (instead of the expected one) is something like:
weather-locations-local-weather/brändö (which belongs to a term from uninstalled weather block module).

Also when I try to re-install weather block module none of the modules default taxonomy terms get recreated and the page at config/weather_block/taxonomies is blank.

I then go on to inspect the table taxonomy_term_hierarchy in the database I find that there are leftover pairs of {tid, parent} from the weather block module's taxonomies which are causing duplicate entries and hence the INTEGRITY CONSTRAINT VIOLATION ERROR. The uninstall of weather block does seem to remove data from taxonomy_term_data table but leaves cleaning of the taxonomy_term_hiercarchy.

Could anyone suggest a simple way of repairing the broken drupal installation/database.

Comments

aanjaneyam’s picture

I manually deleted all the weather_block related {tid,parent} rows from taxonomy_term_hierarchy table. This seems to have fixed the problem. The module uninstall procedure should do this automatically.

aalamaki’s picture

Ok will have a look at that one, thanks for reporting...should be a simple thing to fix :)