I have precisely the problem described in d6_term_node migration overwrites node changed timestamps:

The d6_node migration preserves the original 'changed' timestamp for nodes on migration. But, then the d6_term_node migration comes along and sets 'changed' to the import time for any nodes with term references.

The bug has been open for 4 years. As a novice, I do not know how to fix the problem.

A workaround is suggested in comment #28:

As a possible ugly work-around, add 0.01 to the timestamp ('changed' += 0.01) to keep the existing value. Because php will treat these as != but when mysql goes to insert into an integer column in the DB, it will round down and set to the same value.

However I have been unable to find a simple example to crib from that performs this task. Pointers to a tutorial would be greatly appreciated.

  • Based on the following comment #29, it sounds like the comment is referring to do something like $row->setSourceProperty('changed', $query->execute()->fetchField() +1 0.01); in the prepareRow method of TermNode source plugin. You just reach out the commentators in the thread for more specifics. – Shawn Conn Aug 15 '20 at 22:02
  • @ShawnConn thanks for the pointer. this is still over my head but I'll investigate correct syntax. For now I have worked around the problem by simply commenting out the $this->value = REQUEST_TIME assignment in ChangedItem.php during the term migration – jhnc Aug 16 '20 at 10:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.