The uninstall hook is not implemented in scheduler.install, which means that the databasetables, variables etc. are not cleaned up when uninstalling the module.

CommentFileSizeAuthor
#2 scheduler_uninstall.patch705 byteseric-alexander schaefer

Comments

eric-alexander schaefer’s picture

You are right. We should have an uninstall procedure.

eric-alexander schaefer’s picture

Status: Active » Needs review
StatusFileSize
new705 bytes

Here is a patch with the uninstall function. Please review.

jonathan1055’s picture

Looks good. Two minor points:
(a) why is it necessary to delete the 'scheduler_date_format' variable explicitly, when it would appear that the db_query will delete this anyway?
(b) when the patch was applied I got the message 'stripping trailing CRs from patch'. It worked fine, though.

Jonathan

eric-alexander schaefer’s picture

a) Originally I wanted to delete all variables via variable_del().
b) I diff'ed with eclipse in Windows. I guess you patched with something unixey?

I want to make some changes to this anyways. Larry Garfield pointed out it would be better to track removed node types via hook_node_type() and remove their configuration variables imediately ('scheduler_NODETYPE' and 'scheduler_touch_NODETYPE'). On uninstall only the variables regarding the remaining node types need to be removed (e.g. via node_get_types()). Sound much better and cleaner to me. I'll try it later today.

Thanks for testing.

eric-alexander schaefer’s picture

Status: Needs review » Fixed
eric-alexander schaefer’s picture

Trying to keep 5.x in sync: http://drupal.org/cvs?commit=199044

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

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