GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Here is a very small fix to allow to pass a limit of 0 in the request (to display all resources in one page).
Small fixes to allow limit=0
I'm not sure why you would use getPage to return unlimited results? All getPage does is prepare and cache paged results from other Snippets. It has nothing to do with Resources and has no knowledge of what kind of results the Snippet it calls returns. If you use getResources directly, without getPage, you can pass limit=0.
In my case I don't use getResources. I have a snippet that gets a set of products. I want to display them in page, or allow the user to see them all at once (ie: pass a limit of 0 to the snippet that gets the products).
All in all it does not matter: I don't see the point of /not allowing a limit of 0/ for getPage, since other values are accepted in the $_REQUEST.
Note: I had the same need, it's part of a commit I did 10 months ago (but was never pulled into the master),
I'll go ahead and merge this and just put a warning in the docs about using limit=0
FWIW oori, your PR allowed pageLimit=0, not limit=0.
This has been merged into develop. Please target future pull requests to the develop branch.