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

frankcarey’s picture

Ha! 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?

dave reid’s picture

Status: Active » Closed (won't fix)

Special 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.

jruberto’s picture

So 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.

couloir007’s picture

In the help text of a field, this doesn't work.

tjnormington’s picture

Issue summary: View changes

I was able to escape square brackets in the help field using html special character codes.

left bracket: [
right bracket: ]