I'm using flag with token and there is a problem when I when to put a url in flag message form.
what I need is:
http://bhuntr.com/node/add/forum/14?edit[field_related_match][0][nid]=123
which '123' is the node id. So I type in:
http://bhuntr.com/node/add/forum/14?edit[field_related_match][0][nid]=[nid]
but it comes out:
http://bhuntr.com/node/add/forum/14?edit[field_related_match][0]123=123
how do I use the square brackets in my form without being converted?
Comments
Comment #1
frankcarey commentedHa! thought someone would have this issue too :) for me it was in the custom_links module.
I used percent url encoding to escape it
[ => %5B
] => %5D
so ?edit[field_related_match][0][nid]=123 => edit[field_related_match][0]%5Bnid%5D=123 did the trick. Does anyone think there should be a more elegant solution? maybe [\nid\] would work?
Comment #2
dave reidSpecial characters like that always need to be encoded. It's kind of a common knowledge kinda thing. There's not a good place to document this here.
Comment #3
jruberto commentedSo thankful for this solution. I was about to go crazy trying to craft a prepopulate link in a views "Rewrite the output of this field" which is not only token-enabled, but argument-enabled -- which thwarted my attempts to escape the "n" "i" "d" characters... bravo.
Comment #4
couloir007 commentedIn the help text of a field, this doesn't work.
Comment #5
tjnormington commentedI was able to escape square brackets in the help field using html special character codes.
left bracket: [
right bracket: ]