So here comes the for the cleanup variables in the comment_notify.install

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

greggles’s picture

Status: Needs review » Patch (to be ported)

Thanks so much, Razorraser. I'm marking this "to be ported" for the 5.x branch. I'm not sure how much longer I'll be maintaining that version, but it's good to keep track of these things at least.

aclight’s picture

Version: 7.x-1.x-dev » 5.x-2.x-dev
Status: Patch (to be ported) » Needs review
FileSize
1.72 KB

Here's a direct backport of the patch for D5.

It seems that typically in core and other contrib modules, deleting of variables is done not with a single SQL query (as this patch uses)

DELETE FROM {variable} WHERE name LIKE 'comment_notify_%'

but with a call to variable_del() for each variable that needs to be deleted. I think this is a safer way to do things that eliminates the chance of accidentally deleting a variable that the module itself doesn't control. But that can be changed in a separate issue if necessary.

greggles’s picture

Status: Needs review » Fixed

That's certainly true that this is a little dangerous, but this is also fairly common in contrib (and much easier).

And really, if another module is using the comment_notify namespace...shame on them.

I would certainly like to clean this up in the future, though.

aclight’s picture

Granted, using variables out of the namespace of the module they are created by is a bad idea. But then comment_notify itself uses and deletes a variable named "node_notify_default_mailtext". At least there isn't (yet) a module named node_notify.

Status: Fixed » Closed (fixed)

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