I have a custom page which lives under user/%user/foobar path.

function MY_MODULE_menu() {
  $items = array();
  $items['user/%user/foobar'] = array(
    'title' => 'Foobar',
    'title callback' => 'MY_MODULE_foobar_title_callback',
    'title arguments' => array(1),
    'description' => 'Displays account balance of the current user.',
    'access callback' => 'MY_MODULE_foobar_access_callback',
    'access arguments' => array(1),
    'page callback' => 'MY_MODULE_foobar_page_callback',
    'page arguments' => array(1),
    'type' => MENU_LOCAL_TASK,
  );
  return $items;
}

(Title callback appends %user's name as a suffix to this page's title.)

When I check the foobar page with my administrator user (uid = 21) the result is correct, I see my user's name in the page title, but when I check an another user's (uid = 13671) page I still see my user's name in the page title, however it should be user 13671's username. If I put a dpm() to MY_MODULE_foobar_access_callback() callback to see what arguments this function gets in the $account parameter then the result speaks for itself.

error

Comments

mxr576 created an issue. See original summary.

mxr576’s picture

mxr576’s picture

Status: Active » Needs review
anybody’s picture

#1400314: Shows logged in user's name for page title, breadcrumb on any user page is possibly related! We need more review here to check if this works as expected or has side-effects.