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.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | migrate-flush_messages_for_skipped_rows-3188939-3.patch | 1.03 KB | martin_klima |
Comments
Comment #2
martin_klimaPatch attached.
Comment #3
martin_klimaSorry, wrong --relative dir in the patch. Correct patch attached.
Comment #4
joseph.olstadtriggered more testing