In the prepare() method of DateMigrateFieldHandler in date.migrate.inc, the timezone of the items are never set. That is,

        $return[$language][$delta]['value'] = $from;
        if (!empty($to)) {
          $return[$language][$delta]['value2'] = $to;
        }

should be

        $return[$language][$delta]['value'] = $from;
	$return[$language][$delta]['timezone'] = $timezone;
        if (!empty($to)) {
          $return[$language][$delta]['value2'] = $to;
        }

. A patch is attached.

I'm not completely familiar with the code, though. Instead of using $timezone directly, should we use date_get_timezone($field_info['settings']['tz_handling'], $timezone);?

As a side note, I noticed another bug while digging through the method. If a delta has a missing value, the function returns prematurely. It should set the NULL value for the delta, and continue the for loop. This is included in the patch below.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

elephant.jim’s picture

Attaching a patch.

elephant.jim’s picture

Issue summary: View changes
mikeryan’s picture

Status: Active » Needs review

Set your patches to "Needs review" for them to be tested and reviewed.

mikeryan’s picture

The solution to the timezone is exactly what I was going to do before I tracked down this issue. This does fix the timezone issue for me - can't speak to the delta issue (which should really be a separate d.o issue and patch).

heddn’s picture

joelstein’s picture