Closed (outdated)
Project:
Migrate Tools
Version:
6.1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 May 2022 at 13:05 UTC
Updated:
28 Sep 2026 at 21:20 UTC
Jump to comment: Most recent
Comments
Comment #2
damienmckennaIt was suggested that #3052115 might help, but it didn't. It was then suggested that #2329253 might also help, but it didn't either.
Comment #3
damienmckennaFYI my migration was based on d7_node_complete.yml and includes the following:
Comment #4
rclemings commentedFWIW mine is (for the article node type):
The combination of #3052115 and #2329253 worked in this case.
Comment #5
jwilson3I can confirm along with #4 that the latest core patches from #3052115 and #2329253, combined with a straightforward mapping like the one below resolves the issue where changed timestamp is set to the current time when using
drush mim someimport --update.The
d7_node_completeversusd7_nodeseems like a red herring, and the only practical difference I see (other than the simplified YAML syntax for the "get" plugin) is that Damien was using the source field oftimestampinstead ofchanged.Comment #6
damienmckennaI reran the migrations after applying the patches of the two issues and they still don't work as expected with d7_node_complete/timestamp.
Comment #7
jwilson3Does it work with d7_node_complete/changed (instead of timestamp)?
Edit: nevermind, just realized node_revision table column name is timestamp.
Comment #8
scotwith1tI ran into this and am also having trouble getting it to work even with the 2 patches mentioned. It turns out in my case that adding `validate: true` (#3073707: Migrations can now opt into validation for content entities) was causing this to fail (getting `The content has either been modified by another user, or you have already submitted modifications. As a result, your changes cannot be saved.` error in the migrate_message table for this migration). Just posting this in case the validate flag is a factor for others as well.
Comment #9
jonathan_hunt commentedfwiw, I found changing from source field
timestampto source fieldchangedworked for me, no patches needed.Comment #10
josephcheekQ: is there any downside to altering the code to configure the code to default to
changed: changedinstead ofchanged: timestamp?Comment #11
stephane aimar commentedSo I was aware of something that update the
changeddate. But thanks to this issue now I know it's when I use--updateBut I'm here from this issue https://www.drupal.org/project/drupal/issues/2329253
And someone made a patch for my 10.3.x branche I'm using here https://www.drupal.org/project/drupal/issues/2329253#comment-15705835
With this patch my changed time is not updated with
migrate --updateComment #12
benstallings commentedComment #13
benstallings commentedSince core 11.4.4, issue #3052115, EntityContentBase::save() calls $entity->setSyncing(TRUE) before saving. With that in place, a mapped changed value is kept on --update.