Uninstalling module and deletion variables
sysname - July 22, 2009 - 06:41
| Project: | Acidfree Albums |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
Uninstall module will delete all variables which names contains 's'. All variables of ALL existing modules & themes.
This statement db_query("DELETE FROM {variable} WHERE name LIKE '%%s%'", 'acidfree');
is equal to DELETE FROM {variable} WHERE name LIKE '%s%'
Need to be
variable_del('acidfree_variable_name_1);
variable_del('acidfree_variable_name_2);
variable_del('acidfree_variable_name_3);Sorry for my bad English.

#1
Subscribing and hoping for a solution. I really want to uninstall this module.
#2
file 'acidfree.install'
ORIGIN
<?phpfunction acidfree_uninstall() {
db_query('DROP TABLE {acidfree_album}');
db_query("DELETE FROM {variable} WHERE name LIKE '%%s%'", 'acidfree');
taxonomy_del_vocabulary(variable_get('acidfree_vocab_id', 0));
db_query("DELETE FROM {blocks} WHERE module = '%s'", 'acidfree');
}
?>
Minimal changes:
-change order of 2nd and 3rd strings
-corrected SQL statement in NEW 3rd string.
<?phpfunction acidfree_uninstall() {
db_query('DROP TABLE {acidfree_album}');
taxonomy_del_vocabulary(variable_get('acidfree_vocab_id', 0));
db_query("DELETE FROM {variable} WHERE name LIKE '%acidfree%'");
db_query("DELETE FROM {blocks} WHERE module = '%s'", 'acidfree');
}
?>
#3
That seems to have done the trick. Thank you very much for the update!