To recreate: 1 - Set AllowHoldPolicyOverride to allow 2 - Set RESTdefaultPageSize = 5 3 - Try to place a hold 4 - Note list is truncated and marked as needing override
Created attachment 130853 [details] [review] Bug 30133: Avoid calling c->objects->search twice Calling this twice sets double pagination headers, which messes up the page for the requests and retrieves on ly the end of the list This patch simply avoids a doulbe call TO DO: must implement same for Biblio->pickup_locations and cover with tests
Created attachment 130854 [details] [review] Bug 30133: Avoid calling c->objects->search twice Calling this twice sets double pagination headers, which messes up the page for the requests and retrieves on ly the end of the list This patch simply avoids a doulbe call TO DO: must implement same for Biblio->pickup_locations and cover with tests
Created attachment 130855 [details] [review] Bug 30133: Avoid calling c->objects->search twice Calling this twice sets double pagination headers, which messes up the page for the requests and retrieves on ly the end of the list This patch simply avoids a doulbe call TO DO: must implement same for Biblio->pickup_locations and cover with tests this also returns all as needing override
*** Bug 30126 has been marked as a duplicate of this bug. ***
Created attachment 130883 [details] [review] Bug 30133: Regression tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 130884 [details] [review] Bug 30133: Avoid calling c->objects->search twice Calling this twice sets double pagination headers, which messes up the page for the requests and retrieves on ly the end of the list This patch simply avoids a doulbe call TO DO: must implement same for Biblio->pickup_locations and cover with tests this also returns all as needing override Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 130885 [details] [review] Bug 30133: Simplify code This patch simplifies the code, and also fixes a problem with branchcode comparisson failing, highlighted when running the tests To test: 1. Apply the regression tests 2. Run: $ kshell k$ prove t/db_dependent/api/v1/items.t => FAIL: Tests fail. Notably: - Link header pagination is wrong - X-*Total-Count headers have two values (dupicated) 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! 5. Sign off :-D
Created attachment 130886 [details] [review] Bug 30133: Regression tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 130887 [details] [review] Bug 30133: Avoid calling c->objects->search twice Calling this twice sets double pagination headers, which messes up the page for the requests and retrieves on ly the end of the list This patch simply avoids a doulbe call TO DO: must implement same for Biblio->pickup_locations and cover with tests this also returns all as needing override Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 130888 [details] [review] Bug 30133: Simplify code This patch simplifies the code, and also fixes a problem with branchcode comparisson failing, highlighted when running the tests To test: 1. Apply the regression tests 2. Run: $ kshell k$ prove t/db_dependent/api/v1/items.t => FAIL: Tests fail. Notably: - Link header pagination is wrong - X-*Total-Count headers have two values (dupicated) 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! 5. Sign off :-D
Created attachment 130889 [details] [review] Bug 30133: Fix pagination in /biblios/:bibio_id/pickup_locations This patch does the same thing we did for items on the previous patch, but for biblios. The tests are almost the same as well. To test: 1. Apply this patch 2. Run: $ kshell k$ prove t/db_dependent/api/v1/biblios.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 130890 [details] [review] Bug 30133: Regression tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> https://bugs.koha-community.org/show_bug.cgi?id=30113
Created attachment 130891 [details] [review] Bug 30133: Avoid calling c->objects->search twice Calling this twice sets double pagination headers, which messes up the page for the requests and retrieves on ly the end of the list This patch simply avoids a doulbe call TO DO: must implement same for Biblio->pickup_locations and cover with tests this also returns all as needing override Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> https://bugs.koha-community.org/show_bug.cgi?id=30113
Created attachment 130892 [details] [review] Bug 30133: Simplify code This patch simplifies the code, and also fixes a problem with branchcode comparisson failing, highlighted when running the tests To test: 1. Apply the regression tests 2. Run: $ kshell k$ prove t/db_dependent/api/v1/items.t => FAIL: Tests fail. Notably: - Link header pagination is wrong - X-*Total-Count headers have two values (dupicated) 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! 5. Sign off :-D Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> https://bugs.koha-community.org/show_bug.cgi?id=30113
Created attachment 130893 [details] [review] Bug 30133: Fix pagination in /biblios/:bibio_id/pickup_locations This patch does the same thing we did for items on the previous patch, but for biblios. The tests are almost the same as well. To test: 1. Apply this patch 2. Run: $ kshell k$ prove t/db_dependent/api/v1/biblios.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> https://bugs.koha-community.org/show_bug.cgi?id=30113
Created attachment 130953 [details] [review] Bug 30133: Regression tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 130954 [details] [review] Bug 30133: Avoid calling c->objects->search twice Calling this twice sets double pagination headers, which messes up the page for the requests and retrieves on ly the end of the list This patch simply avoids a doulbe call TO DO: must implement same for Biblio->pickup_locations and cover with tests this also returns all as needing override Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 130955 [details] [review] Bug 30133: Simplify code This patch simplifies the code, and also fixes a problem with branchcode comparisson failing, highlighted when running the tests To test: 1. Apply the regression tests 2. Run: $ kshell k$ prove t/db_dependent/api/v1/items.t => FAIL: Tests fail. Notably: - Link header pagination is wrong - X-*Total-Count headers have two values (dupicated) 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! 5. Sign off :-D Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 130956 [details] [review] Bug 30133: Fix pagination in /biblios/:bibio_id/pickup_locations This patch does the same thing we did for items on the previous patch, but for biblios. The tests are almost the same as well. To test: 1. Apply this patch 2. Run: $ kshell k$ prove t/db_dependent/api/v1/biblios.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 130957 [details] [review] Bug 30133: (follow-up) Update objects.search POD Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Pushed to master for 22.05, thanks to everybody involved [U+1F984]
(In reply to Fridolin Somers from comment #21) > Pushed to master for 22.05, thanks to everybody involved [U+1F984] \o/
Pushed to 21.11.x for 21.11.03
Pushed to 21.05.x for 21.05.13
About backporting to 20.11.x, this depend on bug 27931, right? 20.11.x doesn't seem to have the route used in the tests so it shouldn't be affected at all.
(In reply to Victor Grousset/tuxayo from comment #25) > About backporting to 20.11.x, this depend on bug 27931, right? 20.11.x > doesn't seem to have the route used in the tests so it shouldn't be affected > at all. That's right!