I have implemented/fixed more some more uinstalls.

Also I have extended variable_del() function to have ability to remove variables with specifying wildcard.

e.g. call to variable_del('upload_', TRUE) will remove all variables that begin with 'upload_' - 'upload_test1', 'upload_test2'.
It makes uninstalls easier.

Comments

Frando’s picture

Version: 5.0-beta1 » 5.x-dev
Status: Active » Needs review

setting proper states.

profix898’s picture

Status: Needs review » Needs work

I think you should remove the wildcard functionality from variable_del() for now. New features will not go into Drupal 5 anymore. We also discussed the exact modification to variable_del() some weeks ago and it was rejected.

sun’s picture

Status: Needs work » Closed (duplicate)
stokito’s picture

+1

stokito’s picture

Title: better uninstall handling » Imrovent variable_del(): Allow wildcard in variable name (better uninstall handling)
Version: 5.x-dev » 7.x-dev
Component: other » base system
Category: bug » feature
Priority: Normal » Critical
Status: Closed (duplicate) » Patch (to be ported)

Using of #138544: Allow multiple variable deletes in variable_del() is stupid. This solution is more powerful.

joshmiller’s picture

Status: Patch (to be ported) » Postponed (maintainer needs more info)

I've looked at this patch and it will need more than porting. I like the feature idea, but I think we need to start from scratch on how to implement.

sun.core’s picture

Status: Postponed (maintainer needs more info) » Needs work

Proper status.

sun.core’s picture

Version: 7.x-dev » 8.x-dev
catch’s picture

Title: Imrovent variable_del(): Allow wildcard in variable name (better uninstall handling) » Improve variable_del(): Allow wildcard in variable name (better uninstall handling)
Priority: Critical » Major

Downgrading all D8 criticals to major per http://drupal.org/node/45111

mile23’s picture

Title: Improve variable_del(): Allow wildcard in variable name (better uninstall handling) » Improve variable_del() by adding another function: variable_del_prefix()
StatusFileSize
new2.36 KB

As per #6: Add a function called variable_del_prefix($prefix). Thus variables named mymodule_foo and mymodule_bar would both be deleted by calling variable_del_prefix('mymodule_');

This has a few main benefits:

1) You can delete all variables in your namespace in one go, without potentially demolishing anything else if you have the wrong wildcard somewhere.

2) It imposes (in a very small way) a best practice on developers, such that they standardize their variable names for convenience in hook_uninstall().

3) It could be refactored for efficiency after #138544: Allow multiple variable deletes in variable_del() finally happens.

4) Easy backport to D7. Which I'd really like to see. Please. O please.

dave reid’s picture

I actually think this is a bad idea as it could easily blow away unintended variables.

mile23’s picture

"I actually think this is a bad idea as it could easily blow away unintended variables."

Which unintended variables would those be? The ones that someone else set with my module name as their namespace? variable_del() suffers from the same problem. :-)

catch’s picture

views vs. views_bulk_operations
image vs. imagecache.

wim leers’s picture

Version: 8.x-dev » 9.x-dev
mile23’s picture

Issue summary: View changes

I'm going to go out on a limb and say this is no longer a thing.

catch’s picture

Version: 9.x-dev » 8.0.x-dev
Status: Needs work » Closed (duplicate)

Yes we can call this a duplicate of state/CMI.