When attempting to uninstall the Forum module after having disabled the Taxonomy module, a fatal PHP error will occur because forum_uninstall() makes use of taxonomy_del_vocabulary(), which is no longer available. This has been tested against both beta4 and HEAD.
Steps to reproduce:
- Enable Taxonomy and Forum modules.
- Disable Forum module, and then Taxonomy module.
- Attempt to uninstall Forum module.
- Behold - white screen of death.
- Check PHP log for fatal error.
Faral error produced by bug:
Call to undefined function taxonomy_del_vocabulary() in [...]/drupal-6.0-beta4/modules/forum/forum.install on line 41
Proposed solution:
Do what is needed from taxonomy_del_vocabulary() in a private function in forum.install instead.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | forum_uninstall_commented.patch | 799 bytes | ximo |
| #3 | forum_uninstall-201479.patch | 437 bytes | chx |
Comments
Comment #1
gábor hojtsyWell, forum module depends on taxonomy module, so you should not be able to disable taxonomy module if forum module is enabled. The taxonomy module checkbox should be impossible to uncheck. How did you disable taxonomy module?
Comment #2
ximo commentedI got the error when uninstalling the Forum module, not when disabling Taxonomy. But it was very easy.. I first disabled the Forms module (at this point the checkbox for Taxonomy was greyed out) and pressed Save changes, then I was able to uncheck Taxonomy and save the changes again. If I managed to do it, sooner or later someone else will!
My first thought now was that the function that greys out modules under dependency should pick up even modules that have not yet been uninstalled. But this might just cause confusion - users may not get that they would need to completely uninstall the dependant modules first, not just disable them (as has been the default action).
How about not permitting modules to depend on other modules after they have been disabled (i.e. in hook_uninstall)? Because potentially, the module it depends on may have been disabled by the time you want to uninstall the module in question.. like I found out.
(Btw, sorry for the 'critical'. I got a bit carried away when I saw a white screen of death, I see now that it's unlikely to bug that many users.)
Comment #3
chx commentedComment #4
gábor hojtsychx: hm, I'd add a line of comment about the forum module depending on taxonomy module, but that possibly being disabled by the time forum is uninstalled.
Comment #5
ximo commentedchx's solution is so obvious now that I see it :)
I added a comment and reordered it to look pretty. Good enough?
Comment #6
gábor hojtsyCommitted this one, thanks.
Comment #7
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.