I suggest yout to change the following code in "userpoints_uninstall()" from

db_query("DELETE FROM {variable} WHERE name like '%userpoints%'");

to

db_query("DELETE FROM {variable} WHERE name like 'userpoints_%'");

Because the first code will delete even variables named "mymodule_userpoints_whatever". Sure, if you uninstall userpoints you may not need those any longer but in development stage one does a lot of enable/disable install/uninstall and it can mess things up.

A module should respect namespaces and only clean up his own settings.

Cheers naden

Comments

berdir’s picture

Can you provide a patch?

I basically agree with what you are saying, however, note that in Drupal 7, it is not possible to uninstall userpoints if, e.g., userpoints_nc is still installed.

naden’s picture

StatusFileSize
new502 bytes

Here it is.

mile23’s picture

Status: Active » Needs review

Needs review...

Status: Needs review » Needs work

The last submitted patch, 0-userpoints-6.x-1.x-dev.patch, failed testing.

naden’s picture

This is crazy. Dunno what can go wrong.

berdir’s picture

Version: 6.x-1.1 » 6.x-1.x-dev
Status: Needs work » Needs review

The tests are broken.

berdir’s picture

Status: Needs review » Needs work

Oh, actually, your patch is wrong.

You need to use cvs diff to create a patch or fix the file name in the patch. See http://drupal.org/patch/create

mile23’s picture

Status: Needs work » Needs review
StatusFileSize
new505 bytes

Good catch. Patch for YOU! Merry Xmas. :-)

berdir’s picture

Status: Needs review » Fixed

Thanks commited, 7.x already works like this.

Status: Fixed » Closed (fixed)
Issue tags: -uninstall variables

Automatically closed -- issue fixed for 2 weeks with no activity.