Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm trying to use the webform to redirect to a page where the url determines the content of the page.
I have the custom url like this:
find-locations?country=%safe_key[countrylist]&category=All&store_name=&store_id=%value[storeid]&distance[distance]=100&distance[unit]=3959&distance[origin]=
if the store id field is blank, it spits out the following url with the space(%20) after "store_id=". See the URL it passed below:
find-locations?country=All&category=All&store_name=&store_id=%20&distance[distance]=100&distance[unit]=3959&distance[origin]=&sid=93
How do i fix this?
Comment | File | Size | Author |
---|---|---|---|
#11 | add_trim_7.x-3.x.patch | 864 bytes | ymeiner |
#5 | webform_trim_tokens-1897114.patch | 730 bytes | quicksketch |
Comments
Comment #1
debo7debo CreditAttribution: debo7debo commentedComment #2
debo7debo CreditAttribution: debo7debo commentedComment #3
debo7debo CreditAttribution: debo7debo commentedComment #3.0
debo7debo CreditAttribution: debo7debo commentedremoved the local server domain name from the results
Comment #4
quicksketchI've confirmed this issue still exists for both the 3.x and 4.x versions of the module, but this is not a critical issue. I'm suspecting that there may be some HTTP spec reason for adding the spaces in here,
because Webform isn't doing it by itself. It's either Drupal or the web browser that is adding these spaces.EDIT: Nope, it's Webform. See patch in next comment.To solve this issue, we may need to simply not include those parameters at all if they're empty.
Comment #5
quicksketchThanks to the recent issue at #1244072: Use of tokens in external URL redirect locations not allowed in some cases and not URL Encoded, fixing this in the 4.x version is trivial. Solving in 3.x could be similarly done, but with the token handling completely different, I haven't gotten around to fixing this in 3.x. Any patches to fix 3.x would be appreciate. This patch has been committed to 4.x to solve the problem there.
Comment #6
quicksketchThis probably isn't going to get fixed in 3.x. Any patches are still welcome, but with 4.0 around the corner I'd recommend upgrading.
Comment #7
fenstratNeeds porting to 8.x-4.x.
Comment #8
fenstratCommitted and pushed 427e569 to 8.x-4.x. Thanks!
Comment #11
ymeiner CreditAttribution: ymeiner commentedI had to fix it for 7.x-3.x, created a patch for it for others to use,
enjoy