[Bug 25570] New: Listing requests should be paginated by default
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25570 Bug ID: 25570 Summary: Listing requests should be paginated by default Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: REST API Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com They were supposed to be paginated by default, but we lost that (or maybe just the idea) at some point. If pagination information is not passed, it should default to page 1, and page size to RESTdefaultPageSize. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25570 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25570 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |24229 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24229 [Bug 24229] /items API tests fail on Ubuntu 18.04 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25570 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org, | |martin.renvoize@ptfs-europe | |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25570 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 105229 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=105229&action=edit Bug 25570: Regression tests This tests verify that the default behaviour is to paginate the results. To test: 1. Apply this patch 2. Run: $ kshell k$ prove t/db_dependent/Koha/REST/Plugin/Objects.t => FAIL: $c->objects->search doesn't paginate results by default -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25570 --- Comment #2 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 105230 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=105230&action=edit Bug 25570: Paginate results by default in objects->search This patch makes the helper paginate the resultsif no pagination parameters are passed. Page number defaults to 1, and the page size to the RESTdefaultPageSize syspref value. To test: 1. Apply the regression tests patch 2. Run: $ kshell k$ prove t/db_dependent/Koha/REST/Plugin/Objects.t => FAIL: Pagination is not enforced by default 3. Apply this patch 4. Repeat 2 => SUCCESS: Results are paginated 5. Sign off :-D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25570 --- Comment #3 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 105231 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=105231&action=edit Bug 25570: (follow-up) Fix tests This patch fixes the libraries tests, that expected the old behaviour To test: 1. Run: $ kshell k$ prove t/db_dependent/api/v1/libraries.t => FAIL: Tests fail 2. Apply this patch 3. Repeat 1 => SUCCESS: Tests pass! 4. Sign off :-D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25570 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |normal Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25570 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25570 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #105229|0 |1 is obsolete| | Attachment #105230|0 |1 is obsolete| | Attachment #105231|0 |1 is obsolete| | --- Comment #4 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 105248 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=105248&action=edit Bug 25570: Regression tests This tests verify that the default behaviour is to paginate the results. To test: 1. Apply this patch 2. Run: $ kshell k$ prove t/db_dependent/Koha/REST/Plugin/Objects.t => FAIL: $c->objects->search doesn't paginate results by default Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25570 --- Comment #5 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 105249 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=105249&action=edit Bug 25570: Paginate results by default in objects->search This patch makes the helper paginate the resultsif no pagination parameters are passed. Page number defaults to 1, and the page size to the RESTdefaultPageSize syspref value. To test: 1. Apply the regression tests patch 2. Run: $ kshell k$ prove t/db_dependent/Koha/REST/Plugin/Objects.t => FAIL: Pagination is not enforced by default 3. Apply this patch 4. Repeat 2 => SUCCESS: Results are paginated 5. Sign off :-D Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25570 --- Comment #6 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 105250 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=105250&action=edit Bug 25570: (follow-up) Fix tests This patch fixes the libraries tests, that expected the old behaviour To test: 1. Run: $ kshell k$ prove t/db_dependent/api/v1/libraries.t => FAIL: Tests fail 2. Apply this patch 3. Repeat 1 => SUCCESS: Tests pass! 4. Sign off :-D Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25570 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |19410 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19410 [Bug 19410] Add a helper function for generating object searches for the API -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25570 --- Comment #7 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- I think we should target 20.05.01 for this one. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25570 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #105248|0 |1 is obsolete| | --- Comment #8 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 106070 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=106070&action=edit Bug 25570: Regression tests This tests verify that the default behaviour is to paginate the results. To test: 1. Apply this patch 2. Run: $ kshell k$ prove t/db_dependent/Koha/REST/Plugin/Objects.t => FAIL: $c->objects->search doesn't paginate results by default Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25570 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #105249|0 |1 is obsolete| | --- Comment #9 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 106071 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=106071&action=edit Bug 25570: Paginate results by default in objects->search This patch makes the helper paginate the resultsif no pagination parameters are passed. Page number defaults to 1, and the page size to the RESTdefaultPageSize syspref value. To test: 1. Apply the regression tests patch 2. Run: $ kshell k$ prove t/db_dependent/Koha/REST/Plugin/Objects.t => FAIL: Pagination is not enforced by default 3. Apply this patch 4. Repeat 2 => SUCCESS: Results are paginated 5. Sign off :-D Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25570 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #105250|0 |1 is obsolete| | --- Comment #10 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 106072 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=106072&action=edit Bug 25570: (follow-up) Fix tests This patch fixes the libraries tests, that expected the old behaviour To test: 1. Run: $ kshell k$ prove t/db_dependent/api/v1/libraries.t => FAIL: Tests fail 2. Apply this patch 3. Repeat 1 => SUCCESS: Tests pass! 4. Sign off :-D Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25570 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA --- Comment #11 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Works as expected, tests pass, qa script passes.. Passing QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25570 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact| |martin.renvoize@ptfs-europe | |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25570 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |20.11.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25570 --- Comment #12 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 20.11, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25570 --- Comment #13 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Tomas, if "all" is selected we get an error: [2020-06-25 07:58:51.08130] [2024] [debug] Routing to controller "Koha::REST::V1::Libraries" and action "list" No method pager found for Koha::Libraries Fewer than one entry per page! at /usr/share/perl5/DBIx/Class/ResultSet.pm line 2542. at /kohadevbox/koha/Koha/REST/Plugin/Objects.pm line 127. [2020-06-25 07:58:51.10649] [2024] [debug] 500 Internal Server Error (0.053242s, 18.782/s) Caught by Jenkins on Master_D9 run #1375, t/db_dependent/selenium/administration_tasks.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25570 --- Comment #14 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 106277 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=106277&action=edit Bug 25570: Allow "all", -1 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25570 --- Comment #15 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Is this patch correct? It fixes the problem. I did not manage to find a good place for the tests. Should it be in t/Koha/REST/Plugin/Pagination.t, t/db_dependent/Koha/REST/Plugin/Objects.t or both? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25570 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable CC| |lucas@bywatersolutions.com Version(s)|20.11.00 |20.11.00, 20.05.02 released in| | --- Comment #16 from Lucas Gass <lucas@bywatersolutions.com> --- backported to 20.05.x for 20.05.02 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25570 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Pushed to oldstable Version(s)|20.11.00, 20.05.02 |20.11.00, 20.05.02, released in| |19.11.08 CC| |aleisha@catalyst.net.nz --- Comment #17 from Aleisha Amohia <aleisha@catalyst.net.nz> --- backported to 19.11.x for 19.11.08 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25570 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |victor@tuxayo.net Status|Pushed to oldstable |Pushed to oldoldstable Version(s)|20.11.00, 20.05.02, |20.11.00, 20.05.02, released in|19.11.08 |19.11.08, 19.05.14 --- Comment #18 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Backported to 19.05.x branch for 19.05.14 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25570 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |26143 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26143 [Bug 26143] The API does not handle requesting all resources -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25570 --- Comment #19 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Jonathan Druart from comment #13)
Tomas, if "all" is selected we get an error:
[2020-06-25 07:58:51.08130] [2024] [debug] Routing to controller "Koha::REST::V1::Libraries" and action "list" No method pager found for Koha::Libraries Fewer than one entry per page! at /usr/share/perl5/DBIx/Class/ResultSet.pm line 2542.
at /kohadevbox/koha/Koha/REST/Plugin/Objects.pm line 127. [2020-06-25 07:58:51.10649] [2024] [debug] 500 Internal Server Error (0.053242s, 18.782/s)
Caught by Jenkins on Master_D9 run #1375, t/db_dependent/selenium/administration_tasks.t
This was caught in the wild, and I solved it on bug 26143, before noticing this comment. Sorry dude. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org