Problem/Motivation

If trackChanges option is active, migrate module calls prepareRow() method for all records (even already migrated) and then tests if source data changed or not. If not, the row (record) is skipped.

If a message is queued inside the prepareRow(), the row is skipped, but the message remains in the queue until the first row is really imported. Then all the cumulated messages are saved to the processed record.

Steps to reproduce

- set up trackChanges to TRUE,
- run migrate import with some limit (your code must queueing some messages in prepareRow)
- check migration messages table
- run migrate import again
- check migration messages table. All previously stored messages are duplicated and assigned to the first record imported with the second run.

Proposed resolution

Flush queued messages before skipping unchanged row.
Apply the patch.

User interface changes

No.

API changes

No.

Data model changes

No.

Comments

martin_klima created an issue. See original summary.

martin_klima’s picture

Status: Active » Needs review
StatusFileSize
new1.15 KB

Patch attached.

martin_klima’s picture

StatusFileSize
new1.03 KB

Sorry, wrong --relative dir in the patch. Correct patch attached.

joseph.olstad’s picture

triggered more testing