Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
We need to implement hook_modules_uninstalled() and/or hook_node_type_delete() to make sure we remove unused configuration variables (from the variable table). See #1050424: D7 install updates.
Right now we only remove node type specific variables in scheduler_uninstall() for node types that are returned by node_type_get_types().
Comment | File | Size | Author |
---|---|---|---|
#9 | 1052628_9.scheduler.delete_variables_when_node_type_deleted.d6.patch | 994 bytes | jonathan1055 |
#1 | hook_node_type_delete-1052628-1.patch | 893 bytes | jaydub |
Comments
Comment #1
jaydub CreditAttribution: jaydub commentedPatch attached. I basically just copied the hook_uninstall code and added the aforementioned node type delete hook.
Comment #2
jonathan1055 CreditAttribution: jonathan1055 commentedLooks good and I've tested it. Does exactly as required. The seven variables were being left before, but now they are deleted. Also checked the patch against coder review - all clean.
Just one question - when trying to apply your patch I had to delete the a/ and b/ from infront of
--- a/scheduler.module
+++ b/scheduler.module
I apply patches using
Is there a different way you can produce patches from git which is consistent with non git users?
Comment #3
jaydub CreditAttribution: jaydub commentedI just created the patch the way git patches are documented in every module's version control information page which for scheduler is:
http://drupal.org/project/scheduler/git-instructions
A git patch can be applied by: git apply -v PATCH
I think you could apply with patch by using -p1 instead of -p0 in this case and would still work.
Comment #4
jonathan1055 CreditAttribution: jonathan1055 commentedAh, thanks for the info. I wasn't meaning to criticise, re-reading my post it did sound like that. Sorry.
Just tried with -p1 and it works correctly without editting the path. I should have investigated that myself. Cheers.
Comment #5
rickmanelius CreditAttribution: rickmanelius commentedHi Everyone. This was committed: http://drupalcode.org/project/scheduler.git/commit/099fe14. I ran my own series of tests and it works as expected.
Comment #6
rickmanelius CreditAttribution: rickmanelius commentedComment #7
rickmanelius CreditAttribution: rickmanelius commentedI prematurely set this to "closed (fixed)". Setting to fixed.
Comment #8
jonathan1055 CreditAttribution: jonathan1055 commentedI think this fix should be ported to 6.x.
hook_node_type_delete() is the D7 version of the old way in D6 which uses hook_node_type() with $op='delete'.
I'll make a patch for it.
Jonathan
Comment #9
jonathan1055 CreditAttribution: jonathan1055 commentedHere is a patch for D6.
Comment #10
rickmanelius CreditAttribution: rickmanelius commentedLooks good. Will get into 6.x-1.10
Comment #11
rickmanelius CreditAttribution: rickmanelius commentedCommitted
http://drupalcode.org/project/scheduler.git/commitdiff/b215975?hp=49f45a...
Comment #12
jonathan1055 CreditAttribution: jonathan1055 commentedThank you.