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:
<?php
function YOURMODULE_menu_alter(&$callbacks) {
// DEBUGGING OUTPUT.
foreach ($callbacks as $path => $options) {
$access = $options['access callback'] ? $options['access callback'] : 'user_access';
$page = $options['page callback'] ? $options['page callback'] : 'no page callback';
echo $path . " | ". $page . " | " . $access . " | " . implode(', ', $options['access arguments']) . '<br />';
}
}
?>
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!
Doug Stumberger
www.
dstumberger --AT-- hotmail --DOT-- com