While researching #667856: Switch user list may be empty I found this in HEAD:

  // Add Devel module switch user links.
  $switch_links = module_invoke('devel', 'switch_user_list');
  if (!empty($switch_links)) {
    foreach ($switch_links as $uid => $link) {
      if ($uid == $GLOBALS['user']->uid) {
        continue;
      }

Removing the current user from the list is an 'optimization' that removes essential functionality. I've explained this in the second part of #99531-19: Switch Users should limit the users list to those who are allowed to use it. Please don't do it.

CommentFileSizeAuthor
#3 admin_menu-HEAD.switch-user.patch1.54 KBsun

Comments

sun’s picture

Category: bug » task

Hmmmm... I see your point - although it may be confusing for users that don't use the switch user facility that way.

If we re-add it again, then we should still skip the entire list if there is only one entry (the current user) - to at least remove that confusion.

Care to work on a patch?

salvis’s picture

Just remove

      if ($uid == $GLOBALS['user']->uid) {
        continue;
      }

People who get confused because they only have one user if they only have one user can't be helped...

sun’s picture

Status: Active » Fixed
StatusFileSize
new1.54 KB

Thanks for reporting, reviewing, and testing! Committed attached patch to HEAD.

A new development snapshot will be available within the next 12 hours. This improvement will be available in the next official release.

Next time, please submit a patch...

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.