Bug 19278: Make the pagination plugin use RESTdefaultPageSize
commit54880b1a4ef8a656d270182d368d4254bc811042
authorTomas Cohen Arazi <tomascohen@theke.io>
Fri, 8 Sep 2017 15:20:20 +0000 (8 12:20 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 11 Dec 2017 20:46:59 +0000 (11 17:46 -0300)
tree428ff0ea3e8c60428673989ebd7e5785b82d3b2a
parenta7d333f3cde9b6fe7cdd0f816b9c357e741ce8e9
Bug 19278: Make the pagination plugin use RESTdefaultPageSize

This bug introduces a new syspref RESTdefaultPageSize that is used on
the Koha::REST::Plugin::Pagination plugin to default to a valid value
for the page size if the param is not present on the query.

This patch also considers the situation in which no 'page' param is
passed, and no header should be added.

To test:
- Run:
  $ sudo koha-shell kohadev
 k$ cd kohaclone
 k$ prove t/Koha/REST/Plugin/Pagination.t
=> FAIL: Tests fail because the plugin doesn't behave as the tests
expect.
- Apply this patch
- Run:
 k$ prove t/Koha/REST/Plugin/Pagination.t
=> SUCCESS: Tests pass!
- Sign off :-D

Sponsored-by: Camden County
Sponsored-by: ByWater Solutions
Signed-off-by: Lari Taskula <lari.taskula@jns.fi>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Koha/REST/Plugin/Pagination.pm