Problem/Motivation
While working on #2798363: Implement --idlist options on rollback and messages, I noticed some really wild and crazy things going on in the rollback section of the migrate executable. We loop over the id_map, but then never use the row we are looping over. But as a side "benefit" it advances the rows forward.
Proposed resolution
Let's make the code more extensible and more readable so things like #2798363: Implement --idlist options on rollback and messages can only change a small amount of code, not large hunks of code.
It would be nice, if possible, to backport this to 8.6 as we have a patch (w/ passing tests) in migrate_tools waiting for this feature.
Remaining tasks
- Add a getter for the id_map so we can filter it.
- Refactor the foreach to actually use the value in a loop.
User interface changes
n/a
API changes
n/a
Data model changes
n/a
Comment | File | Size | Author |
---|---|---|---|
#2 | 2999478.patch | 3.7 KB | heddn |
Comments
Comment #2
heddnBased on my reading of http://php.net/manual/en/class.filteriterator.php, I think this small change here will do just the trick.
Comment #3
mikelutzI see what you are trying to do. This solves the issue nicely and lets contrib filter the map list. It also matches the rollback iterator loop over the map with the import loop over the source.
I'm setting to NW based on needing IS update, since you changed plans there and didn't implement the steps outlined. Otherwise I'll RTBC
Comment #4
heddnComment #5
mikelutzComment #6
heddnComment #7
alexpottCommitted 2973442 and pushed to 8.7.x. Thanks!
Comment #9
heddnAny chance on a backport to 8.6?
Comment #11
geek-merlin> Any chance on a backport to 8.6?
+1 for that. The 8.6 lights in #2 are green too.
I suppose this will only get attention if we open a followup.