Problem/Motivation
Using ->range() in EntityFieldQuery returns zero rows. Same if you extend SelectQuery, implement it with parent::range($start, $length) and then call ->range() on the extended class.
Proposed resolution
Remove func_num_args() from the method.
Remaining tasks
None.
User interface changes
None.
API changes
Previously if you called ->range($start) this resulted in 0 rows, it will result in all rows now. Note that MySQL does not support just specifying a start without a limit and so this is a rather pointless call and as it always resulted in 0 rows it's extremely unlikely anyone used it. If you were using ->range($start, $length) where $length can be 0, your code still will work.
Comments
Comment #1
chx commentedComment #3
chx commentedsigh.
Comment #5
chx commentedThis is what happens when i develop on D7 and upload a D8patch.
Comment #7
chx commentedKeeping up w HEAD
Comment #8
Crell commentedchx and I discussed this in IRC previously. This is the correct fix for Drupal 7, but a stopgap for 8. Ideally I'd like to get rid of range() and specify limit and offset in separate methods, but we can do that later.
My only concern is that it would be better to test the builder directly. We should not go through EFQ, which is not part of the database system, to test SelectQuery when we can just test SelectQuery directly.
Comment #9
chx commentedTo the contrary, testing this directly makes no sense as it would require a call to
range(NULL, NULL)which is pretty WTF-y. We do not particularly care how a->range()call results in a removal of range conditions only that in it happens. And if I just use a->range()call that won't catch the bug! Or you want me to extend that class just for a test? That'd be a waste of time and effort.Comment #10
chx commentedIe. if you want me to write another test give me some example code that can be fleshed out into a test.
Comment #11
kscheirer#7: 1461890-7.patch queued for re-testing.
Comment #12
kscheirerRetesting against latest HEAD since it has been over a year.
Comment #14
chx commentedAaand it's gone. From D8 at least.
Comment #15
jibranAccording to #14