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...

CommentFileSizeAuthor
#7 date_element.diff617 byteswhalebeach

Comments

alex_b’s picture

PHP 5.2.4

karens’s picture

Status: Active » Postponed (maintainer needs more info)

I 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 $

karens’s picture

Are you using the Event module? If so, this is a duplicate of http://drupal.org/node/240156.

jason.fisher’s picture

Priority: Normal » Critical

I 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.

function  date_timezone_validate($element) {
  form_set_value($element, $element['#value']['timezone']);
  global $form_values;
  print_r($form_values); 
}

Here, everything is correct I believe (I am changing it from America/New_York to America/Chicago):


    [field_calendar_date] => Array
        (
            [0] => Array
                (
                    [timezone] => America/Chicago
                    [value] => Array
                        (
                            [date] => 2008-05-27
                            [time] => 07:45AM
                        )

                    [value2] => Array
                        (
                            [date] => 2008-05-27
                            [time] => 09:30AM
                        )

                )

.. but by the time we get to _date_field_update, it is wrong again:

    [field_calendar_date] => Array
        (
            [0] => Array
                (
                    [timezone] => America/New_York
                    [value] => 2008-05-27T11:45:00
                    [value2] => 2008-05-27T13:30:00
                    [offset] => -14400
                    [offset2] => -14400
                    [rrule] => 
                )

            [rrule] => 
        )

This is the value that sticks as that date field's original timezone, regardless of my dropdown choice of a different timezone

whalebeach’s picture

subscribe.

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:

<select id="edit-field-fieldname-0-timezone-timezone" class="form-select date-timezone" name="field_fieldname[0][timezone][timezone]">

Is this duplicated [timezone] right way?

karens’s picture

Status: Postponed (maintainer needs more info) » Fixed

I just committed a fix for the problem that probably caused this.

whalebeach’s picture

Status: Fixed » Needs review
StatusFileSize
new617 bytes

Thank 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.

whalebeach’s picture

above patch seems to solve my problem.

karens’s picture

Status: Needs review » Fixed

I 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.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

freelancer-hk’s picture

I 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.