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!