I have had an issue with orphaned pages. Currently, a user has to select a category to associate a new page with. This is all good and much desired. However, the problem is that people leave and delete their categories (for reasons I won't go into here but valid reasons). So, the result is that I have orphaned pages. Is there an easy fix to this that prevents anyone/everyone (except and admin) from deleting a category that has pages/nodes associated with it? Thanks.

Comments

nedjo’s picture

hook_taxonomy http://drupaldocs.org/api/head/function/hook_taxonomy has no validate op, so you don't have much to work with here. However, you can use the 'delete' op to, e.g., reassign any deleted nodes to a new category.