Bugzilla – Attachment 105230 Details for
Bug 25570
Listing requests should be paginated by default
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25570: Paginate results by default in objects->search
Bug-25570-Paginate-results-by-default-in-objects-s.patch (text/plain), 1.28 KB, created by
Tomás Cohen Arazi (tcohen)
on 2020-05-21 21:32:29 UTC
(
hide
)
Description:
Bug 25570: Paginate results by default in objects->search
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2020-05-21 21:32:29 UTC
Size:
1.28 KB
patch
obsolete
>From f69347dfaf6683405f622870c10cec341dacf74f Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 21 May 2020 18:23:01 -0300 >Subject: [PATCH] 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 >--- > Koha/REST/Plugin/Objects.pm | 4 ++++ > 1 file changed, 4 insertions(+) > >diff --git a/Koha/REST/Plugin/Objects.pm b/Koha/REST/Plugin/Objects.pm >index 81cc97633c8..5ae76c1d030 100644 >--- a/Koha/REST/Plugin/Objects.pm >+++ b/Koha/REST/Plugin/Objects.pm >@@ -65,6 +65,10 @@ sub register { > } > ); > >+ # If no pagination parameters are passed, default >+ $reserved_params->{_per_page} //= C4::Context->preference('RESTdefaultPageSize'); >+ $reserved_params->{_page} //= 1; >+ > # Merge pagination into query attributes > $c->dbic_merge_pagination( > { >-- >2.26.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 25570
:
105229
|
105230
|
105231
|
105248
|
105249
|
105250
|
106070
|
106071
|
106072
|
106277