1

I am developing a module to manage Human Ressources. I implement hook_menu with a title_callback like this:

$items['intranet/hr/%user'] = array( 'title callback' => 'user_page_title', 'title arguments' => array(2), 'page callback' => '_hr_redirect_to_personal_data', 'page arguments' => array(2), 'access callback' => 'hr_check_menu_access', 'access arguments' => array(2), 'type' => MENU_NORMAL_ITEM, 'menu_name' => 'navigation', ); 

Users with certain role and the user to whom the HR data belongs can access to this menu, and should see the name of the concerned user. It works perfectly if the logged user has a role, but the title of the menu is "Home" for the user to whom the HR data belongs. I don't understand what's happening as I am implementing hook_menu() the same way the user module does for the user profile page. If I inspect the menu with the devel menu, the title is correct for every user. Any idea on what I am doing wrong ? Thanks!

1 Answer 1

0

I get it !

In my configuration, the path intranet/hr is a view which is not accessible to every user, that's why the children element is not accessible and I have "Home" as the menu title.

Even if I don't know how to change this behaviour, at least I know why it is happening :-)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.