When using the options separately (with 'drush migrate-import'), this works fine. Together however, feedback is given but the import operation does not stop after the requested number of items.
I have not tested this, but suspect this is due to the feedback logic resetting internal counters, http://cgit.drupalcode.org/migrate_tools/tree/src/MigrateExecutable.php?h=8.x-3.x#n356.
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | 2919108.14-fix-limit-condition.patch | 1.46 KB | woutgg |
| #8 | 2919108-8.patch | 1.6 KB | heddn |
Comments
Comment #2
heddnTriaging the issue queue. This seems more major.
Comment #3
mbovan commentedI can confirm that bug happens in 4.x as well.
Comment #4
deviantintegral commentedRemoving the call to resetCounters() fixes this for me.
Comment #6
heddnThanks for your contributions!
Comment #7
woutgg commentedWould this not change the behaviour of the progress messages?
If the counters are not reset anymore, each message will show accumulated progress instead of a delta since the last message.
Note: while looking at the code, I suspect this issue would also surface when rolling back (in onPostRowDelete()), although limiting that is a less common scenario of course.
Comment #8
heddnWould this fix that concern?
Comment #9
woutgg commentedNot completely, as that would not fix the feedback stats when combining feedback and limit.
I had already started adding a separate counter when I noticed
$this->counteris never reset, so using that for the limiting check should be fine (see patch).About the deletion counter: I was mistaken...there is no
--limitoption for rollback.Comment #11
woutgg commentedOops, invalid patch; this one should work.
Comment #12
woutgg commentedComment #14
woutgg commentedSigh, sometimes...
That patch would not have worked anyway (since
$this->counteralso counts already-processed records).This one uses a separate counter. Third time's a charm (have tested locally this time).
Comment #16
heddn