Delete variables when uninstalling Mollom

Gurpartap Singh - June 15, 2008 - 21:22
Project:Mollom
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Gurpartap Singh
Status:closed
Description

AttachmentSize
mollom_hook_uninstall.patch549 bytes

#1

David_Rothstein - June 17, 2008 - 02:08

Nice, yeah, this is definitely needed.

I'm personally a little paranoid about wildcard variable deletion; it really doesn't take a whole lot for another module's variables to accidentally get deleted by code like this.... The attached version uses "mollom_%" rather than "mollom%" (which gives a bit more protection but not much).

A safer way would be to explicitly delete only the variables defined by this module, and use node_get_types() here -- as well as hook_node_type() in the main module -- to deal with cleaning up the variables whose names depend on the node type names. That would be both cleaner and safer... whether it's really worth the effort I'm not sure ;)

#2

David_Rothstein - June 17, 2008 - 02:11

Oops, here's the attachment.

#3

David_Rothstein - June 17, 2008 - 02:13

And here it is for real. Firefox 3 is having some serious issues with drupal.org today...

#4

David_Rothstein - June 17, 2008 - 02:16

This is unbelievable... The file shows up in the preview comment but not in the final post. Looks like I might be filing a bug report after this ;)

AttachmentSize
mollom_hook_uninstall_2.patch550 bytes

#5

Dries - June 17, 2008 - 03:11

Committed to DRUPAL-6. I've also backported the change to DRUPAL-5. Thanks all.

#6

Dries - June 17, 2008 - 03:11
Status:patch (code needs review)» fixed

#7

Anonymous (not verified) - July 1, 2008 - 03:12
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.