Currently, the --idlist argument does not work from the drush command.

This happens because in MigrateExecutable::onPrepareRow(), the values of the source id array (introduced in #2698067: Make idlist command support multiple sourceids) are compared for identity with the item, but their types are different: the ids in array_values($source_id) are ints, while the $item is a string.

The fix is to use a simple equality instead of identity.

CommentFileSizeAuthor
#2 2876788-idlist_strict_compare.patch507 bytesfgm

Comments

fgm created an issue. See original summary.

fgm’s picture

Status: Active » Needs review
Related issues: +#2698067: Make idlist command support multiple sourceids
StatusFileSize
new507 bytes

And a simple patch to address this.

fgm’s picture

Note that this problem will only happen with (contrib / custom) sources using strict typing for ids. Although ids are usually ints in D8 sources, sources provided with core and migrate_tools/migrate_plus return these ints in string form, meaning they don't actually expose the problem because of their technically inaccurate representation of ids.

  • mikeryan committed bcf9b64 on 8.x-4.x authored by fgm
    Issue #2876788 by fgm: idlist broken because of strict comparison
    

  • mikeryan committed c7b6bbd on 8.x-3.x authored by fgm
    Issue #2876788 by fgm: idlist broken because of strict comparison
    
mikeryan’s picture

Status: Needs review » Fixed

Committed, thanks!

Status: Fixed » Closed (fixed)

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