Closed (fixed)
Project:
Webform
Version:
6.x-3.12
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
21 Aug 2011 at 16:57 UTC
Updated:
7 Mar 2012 at 09:30 UTC
Hi,
I am have linked webform to a node type, passing the node title via %get[title].
All works fine, expect when I have an ampersand in the title, in which case only everything before the ampersand and nothing after (incl. the ampersand itself) is passed to the form.
I've tried this with a couple of different themes with the same result.
Any ideas?
Thanks in advance.
Comments
Comment #1
vernond commentedNot a Webform issue. Ampersands are used to separate variables in the get string (e.g. www/example.com/?x=12&y=50). Have you tried encoding the title before putting it in the url string?
Comment #2
limehouse commentedHi
Thanks for the response. You're quite right.
I'm using the custom links module to generate the link, and there doesn't seem to be any way to encode the link there.
I'm not a developer so if you have any suggestions on how to accomplish this they would be most welcome.
Thanks again.
Comment #3
vernond commentedWould it absolutely be the end of the world (and clients can be like that!) if you changed the ampersand in the title to "and"? Otherwise you may need to conjour some custom coding to have the returned url encoded after the other module returns it.
Comment #4
limehouse commentedHi
I did think about it! Unfortunately, the issue applies to a content type with hundreds of different - regularly updated (because clients can be like that!) - nodes.
So I really need a global fix. But you have set me thinking about encoding the nodes before they get into Drupal ('the plan' - although I've never done it before - is to import them in XML via Feeds module from an external DB).
I was using the Contemplate module to create the link in the node when I've had to pass a variable to webform before, but the Custom Link module allowed me the flexibility to add the link in a block.
Any other ideas, please let me know.
Thanks.
Comment #5
quicksketchClosing after lack of activity.
As @vernond said, this really should be handled in whatever module or custom code is printing out your links. If you're already using Contemplate to make the link, you should run your string through urlencode() to make sure it is encoded before being used as a parameter. In any case, we don't provide support for custom coding in the Webform queue, so I'm closing this one up.