If a username contains a space then that username will never show up in the "switch user" far right menu.
I've been able to figure a bit out about what's going on, but can't tell if it's a core, devel or a DAM bug.
Here's what I've figured out:
DAM calls devel_switch_user_list() via module_invoke('devel', 'switch_user_list') in admin_menu_admin_menu() to get the list of users who can be switched to.
Note that devel_switch_user_list() uses l() to generate the relevant link in the form "devel/switch/[username]". If username contains a space then the link generated is eg. "devel/switch/john%20doe" (as it should).
Later, _menu_link_translate() will return false because of this code (line 644 in 6.5):
// Note - skip callbacks without real values for their arguments.
if (strpos($item['href'], '%') !== FALSE) {
$item['access'] = FALSE;
return FALSE;
}
Because of this the DAM menu item for switching to "john doe" never gets added. Let me know if more info is needed.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | admin_menu.patch | 467 bytes | AltaVida |
Comments
Comment #1
sunGreat report, and great analysis. Seems to be obvious that there should be a leading slash before the percent sign. Can you test whether that fixes this bug?
Comment #2
AltaVida commentedI think I've got a really simple and straightforward fix:
We can simply urldecode() the path returned by devel_switch_user_list(). It seems to work perfectly.
See patch.
Comment #3
pwolanin commentedlooking for
/%might be a good idea for core, though it would miss those who foolishly try to put a leading % in their path.Comment #4
sun@AltaVida: Makes even more sense.
Thanks, committed to all branches.
Comment #5
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.