Closed (duplicate)
Project:
Drupal core
Version:
6.x-dev
Component:
forum.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Sep 2007 at 04:10 UTC
Updated:
4 Sep 2007 at 08:34 UTC
Jump to comment: Most recent file
Comments
Comment #1
webchickHere's a patch that just unsets the delete button so the form can't be deleted.
Comment #2
chx commentedYou posted a bit too much. Do not credit me for this, I just unrolled other modules from the patch.
Comment #3
fgmThis works, but I think one should go further. Consider this scenario:
forum_nav_vocabularyremains in the variables tableI think a better patch would also care for
hook_enable/hook_disable.Comment #4
webchickThanks chx! :D
fgm, the only time we should be destructive with data is on uninstall. forum_uninstall() contains code to delete the vocabulary, and once it is run, the next time Forum is enabled, its forum_install() will run, which re-creates it.
It sounds like you're saying that we should account for people going into their databases and manually deleting the record from the variables table. If someone does that, they're on their own. :P
If we deleted the variable on hook_disable, how would we know which vocabulary was Forum's in hook_enable? The vocabulary could've been renamed to 'Spaghetti', and we can't just pick whatever vocabulary has forum topics in it, since a) in 6.x, any arbitrary node type can be added to a forum, and b) multiple vocabularies (free-tagging, "Category", etc.) might be added to those same posts.
Marking this back for review, unless I misunderstood your concern.
Comment #5
fgmWebchick, maybe I wasn't clear enough, sorry.
The case I mentioned was entirely within the Drupal UI. I do not advocate deleting the vocabulary in the module, but described what seems a plausible situation:
My suggestion is therefore to care for this case of a well-meaning webmaster who inadvertently shoots himself in the foot all within the Drupal UI, and I think this could be done by implementing hook_enable, to recreate the module designated by the forum configuration variable.
Comment #6
fgmOK, here is a tentative patch for my suggestion
Comment #7
chx commentedEnrolled your fixes into http://drupal.org/node/172643 .