[development] D6 Cleaning up on module uninstall

nan wich nan_wich at bellsouth.net
Thu Jan 27 00:32:05 UTC 2011

You can easily check to see if any other node types are using the vocabulary and 
issue a warning that you cannot delete it because it is being used in other 
content. Generally someone is going to uninstall soon after install, so the risk 
is minimal.
Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.

From: Gordon Heydon <gordon at heydon.com.au>
To: development at drupal.org
Sent: Wed, January 26, 2011 7:17:48 PM
Subject: Re: [development] D6 Cleaning up on module uninstall


You shouldn't remove the taxonomy on uninstall, as people may be using the 
taxonomy you created for another purpose, and what you originally intended. Just 
on the uninstall let the user know that they should be deleted.

If your module defines the content type Drupal will handle the fact that the 
definition is missing, and the admin can clean up all the nodes, and other 


On 27/01/2011, at 11:09 AM, jeff at ayendesigns.com wrote:

 But what about the fact that the content type of the node, the field definition 
of the fields within it, and the taxonomy vocabulary that categorizes them will 
all be gone? What if someone attempts to edit?
>Do what core does. Do not remove nodes on uninstall. That's better left for a 
>batch process, which is not appropriate for uninstall. 
>>Dave Reid
>>dave at davereid.net
>>On Wed, Jan 26, 2011 at 3:48 PM, <jeff at ayendesigns.com> wrote:
>>I have my module -install- working fine...creating the needed vocabulary, cck 
>>content type with fields, adding the content type to the vocabulary. Now I'm 
>>working on the uninstall, and the seemingly infinite cleanup that's needed, not 
>>that anyone would ever want to remove my module, once installed!
>>>I believe I have the vocabulary and its data, and the cck content type and its 
>>>data accounted for with:
>>>  taxonomy_del_vocabulary($vid); 
>>>  drupal_load('module', 'content');
>>>  content_notify('uninstall', 'my_module');
>>>and that brings me to nodes et al. There will be nodes (and node revisions) to 
>>>be removed, and each node can have multiple field instances (cck image field). I 
>>>don't seem to see a magic function that, given a node type, will remove all 
>>>associated node data for that type. Also, I think I should remove the files that 
>>>were uploaded as cck image content. Any tips on a good example of a complete 
>>>"undo"? :)
>>><ayenlogo.jpeg> Ayen Designs 
>>>388 Bullsboro Drive #105 · Newnan, Georgia 30263 
>>>Blog: theAccidentalCoder.com
>>>Drupal: j. ayen green
>>>IRQ: j_ayen_green
>>>IM (Yahoo) baalwww    (MSN) baalwww at yahoo.com
>>>Skype: ayendesigns 
>>>Ayen Designs is a tradename of the computer services division of 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20110126/44fd9b93/attachment.html 

More information about the development mailing list