Using a custom token for node/number, inserting it in a vieuws send mail, I got following error after sending the mail:
Notice: Undefined index: nl in auto_login_url_tokens_tokens() (line216 of sites/all/modules/auto_login_url_tokens/auto_login_url_tokens.module).
The nl is the language code of the default language of my site (Dutch).
The token generated links do log me in, but don't redirect me to the requested page. Instead I'm logged in to the front page.
How can I fix this? All help is much appreciated!
Kind regards
Gregory
Comments
Comment #1
matrixlord commentedHello,
I believe I know what is the problem. Until I fix it, would you mind to test something for me?
Change line 216 from
to
Comment #2
gregdm7 commentedHello Matrixlord
Thanks for your reply, your suggestion did the trick!
Changing that line, I was automatically logged in and redirected to the appropriate page :-)
NB: I think your auto login url module has the same bug as your auto login url tokens module.
Many thanks!
One more question though:
Using the token in an a tag like so:
<a href=" [user:auto-login-url-tokens-47] " target="_blank">link</a>gives a conflict with the recognition of the tokens. The generated link does log me in, but doesn't contain the right page. The site tries to go to the unconverted token:
/auto-login-url-tokens-47%5DA while ago I did mess around somewhat in the code. I discovered that deleting a part of the code of auto login url resulted in solving the problem. But I forgot how I did it and can't find it anymore. I recall I removed some functions involving the
base_urlnearby line 242 ofauto_login_url.module. And then I used:<a href="http://www.example.com/[user:auto-login-url-tokens-47] " target="_blank">link</a>for the link. Such a solution did work, but it isn't clean, is it?
Maybe you have a better suggestion?
Kind regards
Gregory
Comment #3
gregdm7 commentedOw! Found it!
My solution involved removing (nearby line 240 in
auto_login_url.module)and deleting
return
$absolute_path .'autologinurl/' . $hash;So I could use the token in a link like:
<a href="http://www.example.com/[user:auto-login-url-tokens-47]" target="_blank">link</a>Hope this helps!
Kind regards
Gregory
Comment #4
matrixlord commentedHello gregdm7,
Thanks for the feedback. I updated the module with code from #1.
As for #3, this shouldn't be the case. That is strange...Can you tell what filter modules do you use for mail and the text format? E.g. pathologic.
Comment #5
gregdm7 commentedHey Matrixlord
You're very welcome, thanks for the effort!
I am using a custom filter for the mails send from views send:
<a> <em> <strong> <ul> <ol> <li> <dl> <dt> <dd> <b> <br> <p> <i><br> <p>)A while ago I did use pathologic, but now it is uninstalled from the database and removed from the modules list.
CKEeditor though is still enabled on my "mail" text-format. I didn't try to disable it yet.
I use mail system and mime mail in order to send html mails.
Comment #6
matrixlord commentedI am closing the issue, since we use Entity Metadata Wrappers now.