Problem/Motivation
There are some calls to methods on the idMap through out the sourceBase but it isn't initialized until the rewind() method is called. This generally works because those methods are called with in a loop so rewind() has been called but there isn't a requirement on all of those and it will cause a fatal if that happens.
I left this normal. It would be minor in my opinion but the fatal is a pretty big consequence of the edge case.
Proposed resolution
Initialize idMap in constructor.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | 2591533-10.interdiff.txt | 4.52 KB | neclimdul |
| #10 | idmap_can_be_called-2591533-10.patch | 9.16 KB | neclimdul |
Comments
Comment #2
neclimdulComment #3
neclimdulerr... here's a patch.
Comment #4
phenaproximaCool.
Comment #6
neclimdulstupid bot... I should write a test for this anyways
Comment #7
neclimdulTests! Lots and lots of tests!
Because these tests run outside of the iterator, they exhibit the behavior and the ones that skip rows should fail without the change.
Comment #9
mikeryanNew code, let's use the short array syntax here and below.
Yes, lots of tests! Fully testing prepareRow() might be argued as a bit out-of-scope, but it is a significant hole and this is a good excuse to get it plugged.
Comment #10
neclimdulBah, certain that got pulled over when I copied the module invoke syntax out of the plugin. Quick fix for that.
Comment #11
mikeryanLooks good!
Comment #13
webchickTestbot seems to be a bit constipated atm, but https://dispatcher.drupalci.org/job/default/34040/testReport/ shows a clean test run.
Committed and pushed to 8.0.x. Thanks!
Comment #14
webchickRetroactively tagging, since this impacts the migration system which is experimental.