opengeek / getResources

A MODx Snippet for iterating a collection of MODx Resources
http://rtfm.modx.com/display/ADDON/getResources
27 stars 22 forks source link

Bug with "limit=0" and "offset=x"? #92

Closed mindeffects closed 6 years ago

mindeffects commented 10 years ago

Hi Jason, it seems that the "limit" parameter, when set to "0", overwrites any "offset" parameter. I allways thought of "limit" as "the number of elements starting to count at the offset", like "start at element 6 and continue until you reach the end". This is not possible with limit=0 – but with limit=9999 which is somehow "bad style", right? Whats the bigges possible integer? ;-) cheers Oliver

jcamachott commented 9 years ago

Bug experienced! Hopefully will be fixed.

bYemma commented 6 years ago

Bug also experienced.

Oliver, thank you for the workaround while it's not fixed.

opengeek commented 6 years ago

You cannot use limit=0. That is simply an invalid limit.

bYemma commented 6 years ago

Ok, so the MODX Extras page ist wrong: limit | Limits the number of resources returned. Use 0 for unlimited results. | 5 [https://docs.modx.com/extras/revo/getresources]

opengeek commented 6 years ago

No. You cannot use an offset if you use a limit of 0 is what I mean. This is a MySQL limitation.