Problem/Motivation
This is a followup to #3086238: getHighestId() should not fail when there is a destination id with type string. Well, actually this reduces the scope of that one.
While working on #2746541: Migrate D6 and D7 node revision translations to D8 it was discovered that Sql::getHighestId() always returns the highest value for the first destination field, destid1. This is fine for all current core migrations. However, in a node master migration likely to be introduced for handling the migration of node revision translations and entity translation revisions we will need to get the highest revision Id. So some changes are needed to allow that to happen.
And this needs to work easily with the Audit interface, particularly IdAuditor::audit().
Proposed resolution
Deprecate getHighestId() and introduce a new method getMaximal($id_name = NULL) that will accept an input parameter. The new method will use that parameter if it exists, and if not it will keep the legacy behavior, which is to return the highest ID of the first destination id. The new method will also allow for a destination id to be a non-integer.
Remaining tasks
Decide on the name for the new method, currently getMaximalId()
Make a patch, with tests
Review
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | interdiff-2-6.txt | 1.94 KB | dinesh18 |
| #6 | 3091004-6.patch | 11.64 KB | dinesh18 |
| #2 | 3091004-2.patch | 12.1 KB | quietone |
Comments
Comment #2
quietone commentedHere is the work in progress patch from #3086238: getHighestId() should not fail when there is a destination id with type string before that was reduced in scope.
There is some credit in the originating issue that needs to be consider, larowlan, heddn, dinarcon and Gábor Hojtsy all contributed reviews.
Comment #3
quietone commentedComment #4
quietone commentedThe current patch doesn't work nicely with IdAuditor::audit() and that needs some thought and ideas.
Comment #5
mikelutzWe cannot deprecate in drupal:8.9.0 for removal in drupal:9.0.0. The RMs are still deciding whether we will deprecate in 8.9 and remove in 10.0.0 or wait until 9.1 to add the deprecation.
Same here. We may just want to leave both methods in for now.
Comment #6
dinesh18 commentedHere is the updated patch and interdiff as per #5
Comment #7
mikelutzI'm setting this to NW for #4