Hi,
Subjects sounds strange, but let me explain :) This module should be renamed because it interferes with og and og_menu modules.
This module has a hook hook_menu_node_update();
Drupal core has a hook hook_node_update();
og_menu has an implementation of hook_node_update with function name og_menu_node_update(). When module_invoke_all runs on 'menu_node_update', it thinks that that og module implement this hook, but actually, it is og_menu which implements node_update(). All function_exists success because og_menu implements the function name, but the system crashes on entity_extract_ids().
What does the community thinks?
Regards
Comments
Comment #1
agentrickardEasier to rename the hook.
Comment #2
rv0 commentedGot burned by this too.
Luckily this module provides a wrapper for the invoke, which means the code only has to change in one place (well, that and the menu_node.api.php file)
in _menu_node_invoke it has:
Some suggestions for changing it:
Any other suggestions for a name? Willing to provide a patch if we can agree on a suitable name.
Comment #3
rv0 commentedBetter title.
Comment #4
rv0 commented*Bump
Can't believe I got burned by this again.
Attaching patch this time
Comment #6
rv0 commenteddidnt see the test module, updated patch
Comment #7
rv0 commentedComment #8
stefan.r commentedPatch looks good but it will break custom modules implementing the obsolete hooks. Perhaps we should do a check in hook_requirements() as to whether any other modules implement any of the obsolete hooks and throw a warning if so?
Comment #9
rv0 commentedHavent written anything like that before. I'm willing to write it the next time I get burned by this issue ;)
Comment #10
cravecode commentedWanted to confirm this patch works for me. Maybe instead of worrying about legacy support, this patch gets rolled into a release with a major release number change and a short release note mentioning the change.
Comment #11
agentrickardThis module could use a new maintainer to push that through.
Comment #12
Babou commentedThe patch works for me but I don't like that approach. It can potentially break something on at least 10k websites if they update the module once this is released.
I would rather look at this issue the other way around and check the value received in the hooks implementations done on
og_menu.This issue does not affect all modules ending with menu. It affects
og_menuonly becauseogexists and Drupal thinks that the functionog_menu_node_insert/update/deleteis part of theogmodule (more info available here #2601170).Comment #13
rv0 commentedSo you suggest I add stupid checks to OG Menu code which may or may not cause issues while the real issue is poor naming of hooks here?
Well.. OG Menu is clearly outnumbered so I guess I should then :(
Comment #14
Babou commentedI agree the checks looks a bit silly, especially in a hook implementation, but I tend to think that it's a good practice to test the values we get as parameters instead of blindly relying on them.
In this case, I find it personnaly less risky to patch
og_menuwith the aforementioned checks than to change the poolry named hooks in a module containing API in its name :)Comment #15
Babou commentedOr, alternatively, you could write your own module_invoke_all function to filter out the undesired function with a blacklist (exposed as a variable in the GUI).
Which sounds silly as well. Maybe I need some rest.
Comment #16
joelpittetLet's do this as the menu hooks are core and the conflict there is likely more common.
Comment #17
rv0 commentedBump
OG Menu has been updated to 3.1 now, without any fix for this.
Comment #18
rohittiwari commentedHey guys any update on this, which approach is going to be used renaming the hook or module?
Comment #19
vuilComment #21
vuilComment #22
vuilI close the issue as Fixed.