Uninstall hook missing

beltofte - January 22, 2009 - 13:40
Project:Scheduler
Version:6.x-1.3
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Issue tags:uninstall
Description

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

#1

Eric Schaefer - January 26, 2009 - 18:38

You are right. We should have an uninstall procedure.

#2

Eric Schaefer - April 18, 2009 - 14:18
Status:active» needs review

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

AttachmentSize
scheduler_uninstall.patch 705 bytes

#3

jonathan1055 - April 19, 2009 - 09:04

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

#4

Eric Schaefer - April 19, 2009 - 10:05

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.

#5

Eric Schaefer - April 19, 2009 - 11:30
Status:needs review» fixed

Committed: http://drupal.org/cvs?commit=199040

#6

Eric Schaefer - April 19, 2009 - 11:37

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

#7

System Message - May 3, 2009 - 11:40
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.