sync might be too strict during id comparison; rolls back everything

Created on 3 January 2020, over 5 years ago
Updated 23 January 2023, over 2 years ago

I was noticing with a migrate_plus Url migration that the sync option was rolling back everything each import when the source had not changed. It's because the in_array id check (https://git.drupalcode.org/project/migrate_tools/blob/8.x-4.x/src/EventS...) is pretty fragile. In my case, $row->getSourceIdValues() was returning:

[ 'item_id' => INT ]

while $id_map->currentSource() was returning

[ 'item_id' => STRING ]

which causes a false negative for the strict in_array check.

I don't think this is the fault of migrate_tools, but I think it can be prevented. Incoming patch hashes IDs to JSON before comparison, which fixes my use case but might be inefficient.

๐Ÿ› Bug report
Status

Needs review

Version

5.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024