API page: http://api.drupal.org/api/drupal/includes--pager.inc/function/PagerDefau...
Describe the problem you have found:
Parameters docs say: "$limit An integer specifying the number of elements per page. If passed a false value (FALSE, 0, NULL), the pager is disabled."
Reading the above, I assumed setting $limit to a false value would disable the pager and return all results. In fact, PagerDefault::execute returns no results when $limit is a false value, it simply returns. According to ::execute()'s docs, however, returning no results appears to be intentional...
If that's the case and returning no results when $limit is a false value is the expected behavior, it would be clearer I think if the docs for ::limit() say something along the lines of "If passed a false value (FALSE, 0, NULL), the query will return no results."
Or if setting limit to FALSE should disable the pager and return *all* results as the docs for this function imply, PagerDisplay::execute needs to be patched.
Anyone know which is the way to go?
Comments
Comment #1
jhodgdonAgreed. The execute function has this comment in the code:
The documentation for the ::limit() method needs to correspond. I think the doc for the $limit parameter should mention this too.
I like the suggestion above:
"If passed a false value (FALSE, 0, NULL), the query will return no results."
Just needs a patch, and needs to be d8 first, then backported to d7.
Comment #2
damien tournoud commentedThis is called a bug :)
See #1133880: Pager disabling through setting limit as FALSE does not give expected behaviour