This might be related to: http://drupal.org/node/233432
CCK version 1.6.1
Drupal 5.5
"Configurable timezones enabled"
modules installed:
- all CCK modules
- all date 2 modules
I created a content type 'event' with a date with from / to values and the timezone handling set to "date's time zone handling". On the node edit form i can chose a time zone, but it doesn't get stored and falls back to the site's time zone.
I tried to fix, but I can't quite figure out what's wrong, as a screen dump of all parameters in date_field() shows me that on 'validate' the $items' time zone is the site's time zone...
Comments
Comment #1
alex_b commentedPHP 5.2.4
Comment #2
karens commentedI can't replicate this problem on the latest dev version. The latest version has this at the top:
// $Id: date_timezone.module,v 1.8.2.6 2008/04/03 10:32:29 karens Exp $
Comment #3
karens commentedAre you using the Event module? If so, this is a duplicate of http://drupal.org/node/240156.
Comment #4
jason.fisher commentedI am having the same issue, but the Event module has been disabled and uninstalled.
Adding some debugging code to date_elements, it looks like the current site's default (or existing timezone for this field) is possibly being returned and the new value I select in the Timezone dropdown is ignored.
I am stepping through the code to follow the variable.
Here, everything is correct I believe (I am changing it from America/New_York to America/Chicago):
.. but by the time we get to _date_field_update, it is wrong again:
This is the value that sticks as that date field's original timezone, regardless of my dropdown choice of a different timezone
Comment #5
whalebeach commentedsubscribe.
I have same issue with:
Drupal 5.7,
CCK version 1.6.1,
Date_api, Date_timezone, Date.
- with Configurable timezones, updated node and db table has user's timezone.
- without Configurable timezones, updated node and db table has site's timezone.
I wonder date_default_timezone_name() is executed somewhere.
- My Timezone select code in cck node create/update form is:
Is this duplicated [timezone] right way?
Comment #6
karens commentedI just committed a fix for the problem that probably caused this.
Comment #7
whalebeach commentedThank you for the commit.
Your commit helped me a lot but my problem remained.
Then, I might just found another bug.
Could you please review the patch?
The problem seems to be in function date_combo_validate in date_elements.inc.
Comment #8
whalebeach commentedabove patch seems to solve my problem.
Comment #9
karens commentedI committed a different fix for this problem this morning, but thanks for the work. Your fix would work for fields without multiple values, but multiple value fields must always get the timezone changes from the first timezone element, which is the only one exposed to the user.
Comment #10
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #11
freelancer-hk commentedI still face the issue of not being able to set a CCK time zone handling field to values other than 'No time zone conversion'.
My site's time zone is set to Asia/Hong Kong. When I imported dates in mm/dd/yyyy format to CCK date fields via the node import modules, all the dates shown afterward became one day earlier.
I'm running drupal 5.7, cck-5.x-1.7, node_import-5.x-1.6. I've tried both date-5.x-2.0 rc3 & rc4, but the results were the same.
Any clues will be highly appreciated.