By sinasalek on
Hi,
I'm developing a module and have some strange problems with hook_menu. i copied the code from a working module but it does not work exactly like the original menu. I want to know how can i trace menu calls of a specific url from the beginning and know what calculating it does which results in a wrong page, in order to know what's exactly wrong with my implementation.
I'm familiar with devel, and i already searched forum but i couldn't find anything useful.
Thanks.
Comments
First, did you clear the
First, did you clear the cache or rebuild the menus after tinkering with hook_menu? You need to do that in order to see the effect of your changes. Also, you might provide more details on your problem--what is the menu item that you think is not working?
Also, you might try something like this:
once you've defined this in a module, you rebuild your menus or cache. I use this to get a dump of the entire menu structure. This should show you exactly which 'page callback' function is being executed for a given path, provided that there are not downstream modules that use menu_alter to change the structure.
Hope that helps!
So helpful!
Doug - I know this post is 6 years old now, but it totally saved me on a project! There was a menu callback I could not track down for the life of me, and thanks to your trick, I found it hiding in a custom module I didn't even know existed due to its lousy naming convention. So glad you wrote this! I'll keep it for posterity.