[support] 404 or alias for menu hook

Ivan Sergio Borgonovo mail at webthatworks.it
Mon Jan 28 20:03:16 UTC 2008


On Mon, 28 Jan 2008 11:24:17 -0800
"Metzler, David" <metzlerd at evergreen.edu> wrote:

> Yes, 
> 
> In drupal 4 & 5, the parent and default tab should generally have
> the same callback and arguments. My bet in the example that you
> gave in the last email is that the parent path's callback does not
> have a function defined that returns a form.  Does that make sense? 
> 
> That is 
>   admin/settings/mymodule/subsettings and
> admin/settings/mymodule/subsettings/action1 should look the same
> except for the menu type.  

> I know its redundant, but it's necessary.  

> Hopefully this makes sense, but if not, let me know what the tab
> user experience is you're looking for and I'll try and mock up an
> example. 

No, it doesn't make sense or I didn't understand.

That means that in a whole hierarchy of menu all have to call the
same callback and then inside the callback function differentiate the
calls?

That makes the menu system useful just to build up the menu layout
(sort of).

Actually in Pro Drupal Dev. there are examples where the callback is
different in submenus (but none in the admin interface that I could
remember of) and examples where it is the same.

Just in the MENU_DEFAULT_LOCAL_ACTION the callback of the parent is
not repeated, but my parents have a callback.

And yeah I did a mistake reporting the menu...

mymodule_admin_settings3 should actually be mymodule_admin_settings2
so that the MENU_DEFAULT_LOCAL_ACTION callback is the same as the
parent.

So... actually my menu looks like:

$items[] = array(
'path' => 'admin/settings/mymodule',
'callback' => 'drupal_get_form',
'callback arguments' =>'mymodule_admin_settings',
'type' => MENU_NORMAL_ITEM,
);
$items[] = array(
'path' => 'admin/settings/mymodule/subsettings',
'callback' => 'drupal_get_form',
'callback arguments' =>'mymodule_admin_action1',
'type' => MENU_NORMAL_ITEM,
);
$items[] = array(
'path' => 'admin/settings/mymodule/subsettings/action1',
'callback' => 'drupal_get_form',
'callback arguments' =>'mymodule_admin_action1',
'type' => MENU_DEFAULT_LOCAL_TASK,,
);
$items[] = array(
'path' => 'admin/settings/mymodule/subsettings/action2',
'callback' => 'drupal_get_form',
'callback arguments' =>'mymodule_admin_action2',
'type' => MENU_LOCAL_TASK,
);

Even commenting out callback and callback arguments from
MENU_DEFAULT_LOCAL_TASK still doesn't solve the problem.


-- 
Ivan Sergio Borgonovo
http://www.webthatworks.it



More information about the support mailing list