Bugzilla – Attachment 128398 Details for
Bug 29464
GET /acquisitions/orders doesn't honour sorting
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29464: Make GET /acquisitions/orders honour sorting
Bug-29464-Make-GET-acquisitionsorders-honour-sorti.patch (text/plain), 1.85 KB, created by
Lucas Gass (lukeg)
on 2021-12-10 14:27:57 UTC
(
hide
)
Description:
Bug 29464: Make GET /acquisitions/orders honour sorting
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2021-12-10 14:27:57 UTC
Size:
1.85 KB
patch
obsolete
>From 972b42d737a5e0dd7883268ec44f8aee4097b5cd Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 10 Dec 2021 10:17:45 -0300 >Subject: [PATCH] Bug 29464: Make GET /acquisitions/orders honour sorting > >When bug 20212 was pushed, we lost (didn't dig enough to find out how) >the sorting feature for this route. > >This is mainly because biblio+biblioitems filtering prevents the route >to use plain $c->objects->search, so it has baked a custom version of >it. In this case, it missed the call to the dbic_merge_sorting helper, >that takes care of reading the query parameters and inject the sorting >attributes to the resultset. > >To test: >1. Apply the regression tests patch >2. Run: > $ kshell > k$ prove t/db_dependent/api/v1/acquisitions_orders.t >=> FAIL: Tests fail, sorting doesn't actually work >3. Apply this patch >4. Repeat 2 >=> SUCCESS: Sorting works! >5. Test sorting the pending orders on parcel.tt >6. Sign off :-D > >Sponsored-by: ByWater Solutions > >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> >--- > Koha/REST/V1/Acquisitions/Orders.pm | 9 +++++++++ > 1 file changed, 9 insertions(+) > >diff --git a/Koha/REST/V1/Acquisitions/Orders.pm b/Koha/REST/V1/Acquisitions/Orders.pm >index cc12ecd2ff..d3a7033d2d 100644 >--- a/Koha/REST/V1/Acquisitions/Orders.pm >+++ b/Koha/REST/V1/Acquisitions/Orders.pm >@@ -75,6 +75,15 @@ sub list { > $c->stash('koha.embed', $fixed_embed); > } > >+ # Merge sorting into query attributes >+ $c->dbic_merge_sorting( >+ { >+ attributes => $attributes, >+ params => $reserved_params, >+ result_set => $orders_rs, >+ } >+ ); >+ > # If no pagination parameters are passed, default > $reserved_params->{_per_page} //= C4::Context->preference('RESTdefaultPageSize'); > $reserved_params->{_page} //= 1; >-- >2.20.1
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 29464
:
128395
|
128396
|
128397
|
128398
|
129136
|
129137