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

Allow to pass limit = 0 in $_REQUEST #8

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
Contributor

eprochasson commented Sep 9, 2011

Here is a very small fix to allow to pass a limit of 0 in the request (to display all resources in one page).

@opengeek opengeek closed this Sep 9, 2011

Owner

opengeek commented Sep 9, 2011

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.

Contributor

eprochasson commented Sep 9, 2011

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.

Contributor

oori commented Sep 11, 2011

Note: I had the same need, it's part of a commit I did 10 months ago (but was never pulled into the master),
#3

@opengeek opengeek reopened this Sep 12, 2011

Owner

opengeek commented Sep 12, 2011

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.

Owner

opengeek commented Sep 12, 2011

This has been merged into develop. Please target future pull requests to the develop branch.

@opengeek opengeek closed this Sep 12, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment