Problem/Motivation

Zero-valued timestamps are converted to the current time() by MigrationBase::timestamp(), because the value is tested for empty() before is_numeric().

"0" is a valid timestamp, and should be imported as-is. This issue affects $user->access time, for example.

Proposed resolution

Switch the order of the empty() and is_numeric() checks.

Remaining tasks

Patch needs review.

User interface changes

N/A

API changes

N/A

Workaround

For the present I think there is a workaround, MigrationBase::timestamp can be tricked into importing zeros like this:

  // Add to your Migration class
  public function prepareRow($current_row) {
    if ($current_row->access == 0) {
      $current_row->access = "00";
    }
  }

Comments

grendzy’s picture

Status: Active » Needs review
StatusFileSize
new1014 bytes
mikeryan’s picture

Status: Needs review » Fixed

Looks good, committed, thanks!

Status: Fixed » Closed (fixed)

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