Closed (fixed)
Project:
Login one time
Version:
7.x-2.7
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Jul 2012 at 23:52 UTC
Updated:
31 Jul 2012 at 00:41 UTC
Each time that I select to send an email to a user via the admin/people page, the module seems to call login_one_time_get_link() twice.
The first time that it is called, the correct $path is used. The second time, $path is empty, and therefore falls back to the default setting. When the email is sent, it is incorrectly sent with the default path.
Comments
Comment #1
grasmash commentedMy initial analysis was incorrect. The issue is not that login_one_time_get_link() is being called twice-- that doesn't cause problems. Also, it doesn't always default-- it simply goes to the wrong path according to some other pattern that I haven't recognized yet. Still looking.
Comment #2
danielb commentedyeah I think I know what this is, it's because the way tokens are done it works stuff out a 2nd time
Comment #3
grasmash commentedYes. I found the issue, and the fix.
When you call token_replace() in login_one_time_mail(), pass the $path variable:
Then, when you call login_one_time_get_link() in hook_tokens(), pass the data along:
This way, the correct path is generated in the email token.
Comment #4
danielb commentedcheers i've committed your suggestions