I was having users complain that the one-time login's weren't working and that they were being prompted for their current password to change it (which if they had they wouldn't have needed to be sent a login link). In looking at it I noticed that they were sent to user/[uid]/edituser/password . This caught me off guard and I thought it looked a bit odd that they were merged together. Looking through the password_tab contrib code I noticed that the url is created with:
$path .= preg_replace('/\/edit$/', '/password', $path); but it shouldn't be a concatenated onto the end rather it should be replaced. Simply changing it to:
$path = preg_replace('/\/edit$/', '/password', $path); fixed all my issues and now the routing is correct.
Now this is against the 7.1 version and I saw that 7.2 has the password tab split out but wanted to report it for anyone else running into the same issues.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | password_policy-1946198-one_time_login_link-1.patch | 744 bytes | erikwebb |
Comments
Comment #1
erikwebb commentedPlease verify this patch and I'll get this fixed up.
Comment #2
ckoharj commentedIn case this helps. I noticed that this is only a problem when you use the "password change tab". If you disable that in Modules then the request password works correctly.
Thanks,
Comment #3
cellar door commentederikwebb - patch looks good to me. Simple one liner
Comment #4
ckoharj commentedApplied the patch but now getting the following error on the page emailed to user for resetting the password.
Notice: Undefined index: pass in password_policy_password_tab() (line 41 of /home1/cyclonew/public_html/mcacdst/sites/all/modules/password_policy/contrib/password_tab/password_policy_password_tab.pages.inc).Comment #5
erikwebb commentedThis issue doesn't look related to this particular bug. Maybe that's a separate issue to file.
Comment #6
ckoharj commentedI think it is still related to the issue described in the summary. This most recent error only appeared after installing the patch. It did fix the issue where the user was prompted for current password but this error was not there before the patch.
Hope that helps. Thanks,
Comment #7
cellar door commentedCan this get committed? I've got a few projects that could use it
Comment #8
erikwebb commentedThanks for the RTBC. I've committed the patch.
http://drupalcode.org/project/password_policy.git/commit/d9a89c6
Comment #9
ckoharj commentedThanks. I'm not sure what commit means. Is this latest patch in the 7.x-1.5 release or does that release still need the patch?
Comment #10
erikwebb commentedIt will be in 7.x-1.6 when that is released. Since this is the only change since 7.x-1.5 was released, I probably won't put out a new release until I get a few more bugs resolved.
Comment #11
ckoharj commentedThanks.