The 'node-url' token is used by notifications to point users to the node that was added or changed. Without this patch, it always gives a URL with the sites default language.
For example, if you are using domain based language negotiation for a site in both English and Spanish, with URLs http://en.example.com and http://es.example.com, and your default is English, it will always return http://en.example.com/node/123 even if the user in question has Spanish set as their default language.
This patch fixes this problem by looking for the language passed in $options to node_token_values(), which is where notifications passes the user's language.
Please let me know what you think!
Regards,
David.
Comment | File | Size | Author |
---|---|---|---|
#5 | node-url-language.patch | 854 bytes | dsnopek |
node-url-language.patch | 791 bytes | dsnopek | |
Comments
Comment #2
dsnopekHrm. I don't know what that was about! In the log it says "Applied patch token_node.inc cleanly" and then a couple lines later: "This may be a -p0 (old style) patch, which is no longer supported by the testbots".
I really don't know why the testbot tries to run for some projects and not others? I contribute tons of patchs but only sometimes the testbot fires. And apparently I shouldn't be making -p0 patches?
Well, hopefully it will let it be the second time..
Comment #3
Dave ReidYou should be using 'git diff' to make the patches from Git repository clones.
Comment #4
Dave ReidWhere in the notification module does it call token_replace() with the $options['language'] parameter? Because if we want to support this then $options['language'] should be an object just like the D7 token API supports $options['language'].
Comment #5
dsnopekSorry for the super late reply! I got distracted away from the site where this was an issue and FINALLY got a chance to come back to it.
It isn't in the 'notifications' module but in 'messaging' because these tokens are actually expanded in the messaging templates - sorry for the confusion. See the messaging_template_text_replace() function in the messaging_template/messaging_template.module. Note that this is actually a language object, not just the code.
Attached is a new patch made with 'git diff'.
Best regards,
David.
Comment #7
dsnopekGah! I can't seem to get a hang of the testbot. This patch is against a fresh clone of the 6.x-1.x branch. It was created with 'git diff' per the instruction here. Not sure what I'm still doing wrong...