Closed (duplicate)
Project:
Webform
Version:
6.x-2.9
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
9 Nov 2009 at 15:38 UTC
Updated:
30 Apr 2010 at 08:44 UTC
Jump to comment: Most recent file
Comments
Comment #1
quicksketchI'm not sure what you're requesting. If you want the field blank, why not just empty the field default value out entirely?
Comment #2
class47 commentedSorry not to be clear.
I've put the tokens in the webform fields as part of setting up the form. However, they still show through as tokens (such as %profile[profile_addr1]) on the form as viewed by the user in those fields where the profile does not have an entry. Where the profile does have an entry, the form shows it correctly. The blanks are also sent in token form by email.
Comment #3
quicksketchAh, okay now I understand. So if the user has not set an profile_add1 value then the token still shows up in the textfield? Can you confirm this still occurs in the 2.9 version? The 2.8 version didn't handle profile values correctly at all, which is when this probably cropped up (see #604958: %profile and %server default values broken for more info on that).
Comment #4
class47 commentedYes, the problem still occurs with version 2.9.
Comment #5
daengo commentedI just noticed this too when switching to 2.9. I can use most of the tokens but can't use any of the %server tokens, for example, %server[HTTP_USER_AGENT]. It just repeats %server[HTTP_USER_AGENT] back to me when I view the form.
Comment #6
ScottyM-2 commentedI just updated to 2.9 and I am experiencing the same issue with the %profile tokens when browsing the site as an anonymous user, or as a user who does not have a value for the specific token.
Comment #7
tomsm commentedI have the issue too. When an anonymous user opens the webform, he sees all %profile tokens. The %useremail and the %profile select list tokens are not shown. Also see screenshot for more information.
Comment #8
tomsm commentedSorry, screenshot was missing...
Comment #9
lenart commentedSame here. Drupal 5.20 and updated Webform to 2.9. When logged in %profile tokens work as expected. When browsing the site anonymously the fields are filled with %profile[profile_xxx] instead of blank values.
Comment #10
johnla commentedWell, in the token values description it states that only "Authorized Users" can use these tokens:
* %username
* %useremail
* %session[key]
* %post[key]
* %request[key]
* %cookie[key]
* %server[key]
* %profile[key]
I'm trying to figure out if there's a way to allow some of the these tokens to be used by anonymous users.
Comment #11
lenart commentedI've found this fix does the trick for me - http://drupal.org/node/604958#comment-2166032
Now fields for registered users are pre-filled with correct values and blank for anonymous users.
Comment #12
diabolical commentedI'm having the same problem... basics like REQUEST_URI and HTTP_USER_AGENT server keys don't retrieve the actual values, even when I'm logged in as the admin (hence authorized)... any ideas?
Comment #13
jdwfly commentedI've got the same problem. Tokens are not being replaced with 2.9. Personally I am trying to use %server[REQUEST_URI] and it won't even show for uid 1.
Comment #14
jdwfly commentedI added $_server to the unsafe part of the array and this makes it work as advertised.
Just a few lines down there is this...
It is inside of an if statement and it apparently is not working. I suggest moving it to where the rest of the vars are being set as candidates. The only problem I see is this may possibly introduce problems with caching tokens?
Comment #15
diabolical commentedWorked like a charm. Thanks jdwfly!
Comment #16
clivesj commentedI'm trying hard to be able to use %session for default values.
Anyone knows how to do it?
If i enter default value %session['my_module']['my_value'] the token is not replaced.
Thanks for the help.
Comment #17
quicksketchLet's consolidate this with #604958: %profile and %server default values broken.
Comment #18
UNarmed commentedI am having the same issue, hope the fixes mentioned above do the trick =]