jackalope/jackalope — Issue #87: Offset doesn't work without limit
Author: nacmartin
Created: 2012-02-03 23:36:39+00:00
State: open

setOffset is doing weird things with there is no limit set.

With the current implementation, setting an offset and no limit has no effect (returns the same nodes as if there was no offset specified).

I found this:

https://github.com/jackalope/jackalope/blob/master/src/Jackalope/Transport/Jackrabbit/Client.php#L686

if (null !== $limit || null !== $limit) {

I changed the second `null !== $limit` for `null !== $offset`, and whit that change, the behaviour is:

* It returns correctly `(total number of results) - offset` nodes.
* The first node is the same as if you don't apply offset at all.

I am experiencied this while implementing findBy of the ODM using QOM, I arrived here, but no clue on how to continue. I can provide code to test this (broken tests for that findBy method and the method itself).