Delete from Drupal variable table where name LIKE
delete from variable where LIKE drupal
There are occasions when the usual approach:
variable_del('cmt_example_variable');
won't work.
This is not recommended as a shortcut, and in fact even here is problematic should there ever be a module called cmt_teaser_
/**
* Implementation of hook_uninstall().
*/
function cmt_uninstall() {
db_query("DELETE FROM {variable} WHERE name LIKE 'cmt_teaser_%'");
cache_clear_all('variables', 'cache');
}
So this is bad practice, but I don't see
I'm not going to keep track of all the node types that ever were available to Community-Managed Taxonomy and might have had this variable created. I suppose I could just delete the variables for node types currently available to CMT and possibly leave a few variables, is better than the even slighter risk of deleting another modules variables?
Well, if anyone makes a module called cmt_teaser ... let Agaric know!
delete from variable where LIKE drupal
There are occasions when the usual approach:
variable_del('cmt_example_variable');
won't work.
This is not recommended as a shortcut, and in fact even here is problematic should there ever be a module called cmt_teaser_
/**
* Implementation of hook_uninstall().
*/
function cmt_uninstall() {
db_query("DELETE FROM {variable} WHERE name LIKE 'cmt_teaser_%'");
cache_clear_all('variables', 'cache');
}
So this is bad practice, but I don't see
I'm not going to keep track of all the node types that ever were available to Community-Managed Taxonomy and might have had this variable created. I suppose I could just delete the variables for node types currently available to CMT and possibly leave a few variables, is better than the even slighter risk of deleting another modules variables?
Well, if anyone makes a module called cmt_teaser ... let Agaric know!
Comments
Post new comment