Hey!

I was wondering, I've been working with Migrate and Migrate extras for a while and never saw this until today.

When I'm importing NULL values from my DB into my date field, instead of importing null or a blank value, it imports current date.
I'm pretty sure this behavior wasn't happening before. If I could get a confirmation about that it would be great.

Btw I've tracked down the problem to 2 files : date.inc and base.inc

Comments

Anonymous’s picture

Category: support » bug

Update : Just rolled back to 6.x-2.3 and reimported everything. The bug doesn't appear.

mikeryan’s picture

Status: Active » Postponed (maintainer needs more info)

I assume the date field's default value is configured as the current date? And you're expecting the date field to end up empty? What if you add ->defaultValue(NULL) or ->defaultValue('') to your date field mapping?

Anonymous’s picture

First reflex was to check default value of this field and it was already set to Empty. (Not by php code, but by a dropdown list)
Although, default value of the end date wasn't set to empty, but set to Same as start date.

Sorry for poor terms/english, it's not my main language and my Drupal is in french :/

I'll test furthermore later, if I change the end date to Empty.

jangolden’s picture

Hi, I am also having this problem. Migrate version 7.x-2.4+28-dev, Migrate Extras 7.x-2.4. I tried both suggestions in #2, with no luck.
Default date for cck field is set to no default. Any suggestions would be appreciated!

jangolden’s picture

Update: I was able to get around this issue by changing the date widget from select list to pop-up calendar.

aldibier’s picture

Issue summary: View changes

The date.inc the variable $from should be validated to don't calculate timestamp if the variable doesn't have a value.

aldibier’s picture

StatusFileSize
new415 bytes

Here a patch to fix it, I've tested with all widgets.