Closed (fixed)
Project:
Coder
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
4 Jul 2007 at 05:25 UTC
Updated:
4 Feb 2008 at 11:31 UTC
Jump to comment: Most recent file
Guys,
the module doesnt need a dedicated table, but uses the SQL when it uses variable_set/get. so it needs a .install file to deleted these variables. instead using hook_uninstall, you should you hook_disable.
regards,
massa
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | coder_uninstall.patch | 634 bytes | kourge |
| #7 | coder-DRUPAL-5--2.uninstall.patch | 704 bytes | sun |
| #7 | coder-DRUPAL-6--1.uninstall.patch | 704 bytes | sun |
| #5 | coder.install.txt | 567 bytes | nancydru |
Comments
Comment #1
brmassa commentedGuys,
no intention of doing this?
regards,
massa
Comment #2
douggreen commentedWhen you say "guys", you mostly mean "Doug" but also now "Stella". And as I have about 20 modules, these things easily fall off the radar. I do think that this should be in hook_uninstall and not hook_disable, though.
This is on the list to get done. But a patch would help it along. This would also be a nice GHOP task: Write uninstall's for all my modules :)
Comment #3
nancydruI agree, variable_del should be in hook_uninstall.
Comment #4
douggreen commentedSee also #210665
Comment #5
nancydruHere's the whole thing - I don't know how to make diff add a new file.
Comment #6
stella commentedComment #7
sunTwo patches against current 5.x and 6.x.
Comment #8
nancydruI was thinking about this after I uploaded my patch. Cache_menu should also be cleared (and, BTW, Doug, you don't use "if ($may_cache)" in your hook_menu). We should also include
cache_clear_all('coder:', 'cache', true).@sun: I always like to know who deleted a module, that's why the watchdog entry.
Comment #9
sun@nancyw:
(i) drupal_uninstall_module() executes hook_uninstall() in front of removing a module's menu entries. Clearing the cache in hook_uninstall() does not make sense. (btw: This would be a serious Drupal core issue)
(ii) drupal_set_message() does not have a 'notice' type. See http://api.drupal.org/api/function/drupal_set_message/5
(iii) I don't know any other module that inserts a watchdog entry upon module uninstall. I don't think, that should be in Coder, either. However, I think that would be a valuable feature request for D7. Until then, you might propose it as a feature request for http://drupal.org/project/journal
Comment #10
douggreen commentedAs for adding files, see Creating patches, the section on Adding/Deleting files.
Yes we should fix that $may_cache bug. I've noticed that before, and just never fixed it.
I kinda agree with @sun, that we don't need to break new ground on hook_uninstall messages. It should be a core feature.
Comment #11
sunRe: $may_cache for menu items, see http://drupal.org/node/210828
Comment #12
nancydru@sun: i) Okay. But I have seen menu entries remaining.
ii) Hmm, I wonder where I got that from. Guess I need to change lots of modules. BTW, it works though.
iii) I've seen other modules that do it, and certainly mine do. I believe I submitted that feature before D6, but I will go through my issue list and check.
@doug: Yes, I noticed the patches above were done with -N, so I looked it up. Now I know.
Comment #13
kourge commentedRevised patch. Checked for any missed variables.
Comment #14
nancydruRan clean and I had no orphan variables afterwards.
Comment #15
dmitrig01 commentedLooks good to me! (reviewed)
Comment #16
douggreen commentedcommitted, Thanks!
Comment #17
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.