Hello, this issue was initially mentioned here: http://drupal.org/node/1162266#comment-4902686 but i believe it's a separate issue from the "default empty date fields" issue. Thanks for the amazing work on this module!
My issue:
Anonymous users (only), when trying to select the date, are only given 1969 as an option.
...I'm using Webform 6.x-3.12, and Date module 6.x-2.7, and Drupal 6.22. I checked /sites/all/modules/webform/components/date.inc and verified the code from the patch in #14 was indeed already in place with this webform version.
I've tried:
setting a default value for the date component and leaving the default value empty
flushing all caches
deleting the date field and re-adding as a new oneThis only happens for me when anonymous user, everything works when logged in, as mentioned above. This seems to happen whether i have a default value set or not.
please see my screenshot attached...
Update: from http://drupal.org/node/1162266#comment-4977890
...I realized that the reason my date was only showing 1969 available for the year for anonymous users was because under "Default value timezone:" i had "User timezone" selected... of which of course (I suppose?) none is really "selected" for the anonymous user. Simply switching to "Website Timezone" fixed the issue stated in #23 for me. ...
Perhaps an anonymous user's timezone should default to the Website Timezone?
Comment | File | Size | Author |
---|---|---|---|
#4 | webform-anonymous-timezone-fix.patch | 766 bytes | acbramley |
#1 | webform_timezone_anon-d6.patch | 672 bytes | quicksketch |
#1 | webform_timezone_anon-d7.patch | 659 bytes | quicksketch |
Capture.PNG | 12.51 KB | SchwebDesign |
Comments
Comment #1
quicksketchI haven't been able to confirm this problem, but I did find a bug in our timezone handling that matches what you're describing. If custom user timezones are set, a NULL value is indeed often used for anonymous users instead of the default site timezone. I'm not sure if this would solve your date option only providing 1969 as an option, but it seems like it should fix some timezone handling for anonymous users.
Comment #3
acbramley CreditAttribution: acbramley commentedReopening as I'm experiencing the same thing. When using a date field component with the default value set to 'today', and the timezone set to User timezone, anonymous users are seeing the incorrect date (19 July 2012) where authenticated users are seeing 20 July 2012
Comment #4
acbramley CreditAttribution: acbramley commentedThis was being caused by the first if statement passing in webform_strtodate for anon users. This patch fixes that
Comment #5
acbramley CreditAttribution: acbramley commentedComment #6
quicksketchBrilliant. Looks like a more reliable approach than what I had tried before. Committed to both 3.x branches and the 7.x-4.x branch.
Comment #7
acbramley CreditAttribution: acbramley commentedThanks, attribution would be appreciated next time.
Comment #8
quicksketchI posted this patch same as all others, the attribution is inline (part of the comment) rather than official Git way (see http://drupalcode.org/project/webform.git/commit/74afb67cc9297f4cd089b1d...). Currently my patch workflow doesn't involve entering e-mail addresses and names, but in any case your patch wasn't formatted with attribution anyway. I'll probably start including Git attribution when Eclipse starts recognizing it from the Apply patch from clipboard command.