Closed (won't fix)
Project:
Variable Cleanup
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
21 Aug 2006 at 12:57 UTC
Updated:
1 Aug 2011 at 02:05 UTC
Jump to comment: Most recent file
Comments
Comment #1
sanketmedhi commentedMany special thanks to nickl_ on #drupal for this patch. :-)
Comment #2
nickl commented@sanketmedhi great job and congratulations on your first patch!
Another reason we need this feature is because modules store their variables in variable variable names for example this excerpt from upload.module
Here the variable name has the $rid appended to the name and it will currently be impossible to delete without knowing this variable value.
If modules stick with variable naming conventions by prepending module name to variable name then this can be used in hook_uninstall to cleanly clear the variable table from all module variables regardless of their names.
See: http://drupal.org/node/76340
New patch to change comments.
Comment #3
m3avrck commentedCould run into problems with modules with similar names as variables.
Wouldn't this be more precise: %s_% ? Since variables should be moduleName_myvar.
Also, I think that syntax is wrong... I seem to recall it should be: %%s_%% ... that would make it work, and make the searching more precise.
Comment #4
nickl commentedThank you for the review and comments m3avrck
Indeed adding the _ after the module name will make the search more precise and avoid similar modules deleting each others variables. Added to the new patch.
%s_% does have the desired effect which translates to sql:
Comment #5
profix898 commentedThis is a very nice addition. With this patch we only need to drop the tables and call variable_del_all in newly introduced hook_uninstall.
The name variable_del_all is a little misleading IMO, maybe variable_del_module (or similar) is better.
+1
Comment #6
dries commentedNot needed, IMO.
Comment #7
lpalgarvio commentedmoving to contrib...
Comment #8
dalinMarking this as "closed (won't fix)" since I don't see how this makes Variable Cleanup module any better. Can you provide an example of where the existing logic in Variable Cleanup module misses a variable, but this technique finds it?"
Comment #9
lpalgarvio commentedi do not know, as i don't know the inner workings of this module.
but suggesting anyhow.