If I enter an internal URL with a query string such as : node/xxx&foo=bar in a CCK-link field (with a "static title" and "link target" set to default), when I click on that link, the URL requested is : http://mysite.org/?q=node/xxx%26foo%2bar.
If I replace the internal URL with the associated external URL : http://mysite.org/?q=node/xxx&foo=bar, the URL requested is correct.
I have the same behaviour with the 5.x version.
Is there any explanation ?
Comments
Comment #1
prunelle commentedAgain, just to correct some mistakes and be perhaps more clear ... Hoping to get any answer ...
If I enter an internal URL with a query string such as : node/xxx&foo=bar in a CCK-link field (configured with a "static title" and "link target" set to default), when I click on that link in the node content, the URL requested to the browser is : http://mysite.org/?q=node/xxx%26foo%3Dbar and the result is "Page not found".
If I replace the internal URL with the related external URL : http://mysite.org/?q=node/xxx&foo=bar, the URL requested is correct.
I have the same behaviour with the 5.x version.
26 and 3D are the ISO 8859 hexa codes of "&" and "=".
Is this behaviour due to a bug ?
Anyway, it's annoying to have to enter a full URL for a default value. When the site name changes (from test to production site for example), I have not to forget to edit those default values.
Thanks for any answer.
Regards.
Comment #2
jcfiala commentedThat sounds like a bug to me. Thanks for being so specific about the details - that's really helpful for me.
The 'full URL' thing may end up being fixed by #412404: CCK link should take token as part of URL.
Comment #3
mstrelan commentedThis also applies to 7.xThis only applies to 7.x if you are like me and you do something horribly wrong in your template files.Comment #4
jcfiala commentedOkay, I see what the problem is.
You want to go to path node/xxx, with query string foo=bar.
What you're entering is node/xxx&foo=bar
What you should enter is node/xxx?foo=bar
Basically, although with clean urls off, the path you want is ?q=node/xxx&foo=bar, the url handling in drupal assumes that the 'node/xxx' is the path - so you need to put the ? after it.