Posted by zambrey on July 1, 2012 at 3:25pm
13 followers
Jump to:
| Project: | Webform |
| Version: | 7.x-4.x-dev |
| Component: | Miscellaneous |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
The new token support is great, I have one question though related to [current-page:url] token.
When submitting a form in block I would expect that [current-page:url] returns url of the page I'm currently on. Instead it points to webform url.
It happens in emails and redirection. Is it a bug or normal behavior?
Comments
#1
That's odd, I would expect it would do the page you're on also. I haven't confirmed this problem, but it sounds like a bug to me.
#2
I'm using a webform in a block and the token [current-page:url:brief] correctly shows the page url.
#3
I'm using alpha4 and it still redirects me to webform page.
#4
+1 same thing for webform alpha4
#5
+1 same thing to me on alpha4, page title and redirect to the webform page, not the block page.
#6
After some tests if found that using a hidden field with a token value [current-page:title], it works with hidden type "Hidden element" but don't works with "Secure value".
With hidden element the value is already populated in the form, maybe with secure is populated only after submit, so the current page is no more the page with block but the webform page, right?
#7
Guys, you can solve this with custom token module. Create new token with php code:
<?phpreturn 'http'.(empty($_SERVER['HTTPS'])?'':'s')."://{$_SERVER['SERVER_NAME']}{$_SERVER['REQUEST_URI']}";
?>
And then use it instead of [current-page:url]
#8
Is not a clean solution, can work with the page url, but for the page title?
The problem is how webform use the "Secure value", if not enabled everything work fine.
#9
I can confirm this problem with version 7.x-4.0-alpha6+0-dev
Everything works as expected (token values come from the page the form was submitted from) if the hidden type is set to "Hidden element" but not if the hidden type is set to "Secure value"
I have the form in a block and I'm using the custom tokens module to add a token for the page author's email address, so I really must use "Secure value" to keep this value out of the HTML sent to the browser.
Maybe the issue title should be updated to reflect the problem is specific to Hidden components with a secure value type.
#10
In my testing I wasn't actually using the custom tokens module - I was using the current-page:title token which exhibits the problem. I currently have 2 hidden components both set to current-page:title one secure and one hidden element. They end up with different values when I look at the results.
The token generated by the custom token module works as it should, when it is secure or a hidden element.
#11
It all seemed to start behaving as expected for me when I ticked "Show all webform pages in block" in the block settings.
#12
Post #11 is the solution!
#13
Thanks a lot whizzkid, it solved my problem !!!!!
#14
#11 solved my problem too..