Download & Extend

Shows logged in user's name for page title, breadcrumb on any user page

Project:me aliases
Version:7.x-1.0
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

Hello and thanks for this module. I am experiencing a strange bug: I am logged in as the super admin (UID 1). When me aliases is disabled, I can go to user/#/edit (where # is the uid of any existing user) and see the user edit page like normal. When me aliases is enabled, no matter what user's UID I put in, the breadcrumb and page title shows my (admin, user #1) information instead of the user whose UID I entered.

The same thing happens if I am logged in as a different user who is also an admin: user/#/edit always show the user I am logged in as in the page title and breadcrumb.

The rest of the page is usually filled with the correct information. For example, if I go to user/10/edit when logged in as user 1, all of user 10's information will show below the incorrect breadcrumb and page title.

I have tried to trace the origin of this bug but have had no luck.

Comments

#1

I can confirm that it isn't just for user 1, when any user edits another user's profile2 tabs it displays with wrong breadcrumbs and title.

#2

I wrote a custom module with a form_alter script to combat this...

/**
* Implementation of hook_form_alter().
*/
function custom_form_alter(&$form, &$form_state, $form_id) {
switch ($form_id) {
// Modify User profile form
case 'user_profile_form':
// Breadcrumb navigation
        $breadcrumb[] = l(t('Home'), NULL);
        $breadcrumb[] = l($form['#user']->name, 'user/'.$form['#user']->uid);
$breadcrumb[] = l(t('Edit'), 'user/'.$form['#user']->uid.'/edit');
$breadcrumb[] = l($form['#user_category'], $form['#action'], array('absolute' => 'TRUE'));
drupal_set_title($form['#user']->name);
drupal_set_breadcrumb($breadcrumb);
  break;

  }
}