Problem/Motivation
If a new MigrateSkipRowException('some message', FALSE) is thrown in a processor ::transform() method, the second argument $save_to_map (here FALSE) is not respected when writing to id map.
There are processors that don't want to record such mappings because, for instance, they are skipping rows where the $value cannot be saved in id map. Example 'foo' cannot be saved in 'source1' of type integer.
The "test only" patch from #3 proves the bug.
Proposed resolution
Write automated test (see #3)Propose a fix (see #4)
Remaining tasks
Review test and fix.
User interface changes
None.
API changes
None.
Data model changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | interdiff.txt | 1.4 KB | claudiu.cristea |
| #4 | 2818799-4.patch | 3.5 KB | claudiu.cristea |
| #3 | 2818799-3-text-only.patch | 2.88 KB | claudiu.cristea |
Comments
Comment #2
claudiu.cristeaComment #3
claudiu.cristeaPatches.
Comment #4
claudiu.cristeaTypo.
Comment #6
claudiu.cristeaComment #7
imiksuSome improvements on bug description, summary and title.
Comment #8
imiksuComment #9
claudiu.cristea@iMiksu, thank you for taking care
Comment #10
benjy commentedThis looks good to me, personally i'd like to have seen $save_to_map default to TRUE because
$id_map->saveIdMapping($row, array(), MigrateIdMapInterface::STATUS_IGNORED);is invalid anyway. When you attempt to rollback, you'll get cannot flip non-string or integer value errors when it attempts to load null which is saved as the destination id, but that's an existing issue.Comment #11
claudiu.cristea@benjy, thank you. This is somehow related, can you take a look? #2818871: Allow logging skip row exception messages.
Comment #14
catchCommitted/pushed to 8.3.x and cherry-picked to 8.2.x. Thanks!