Bugzilla – Attachment 117441 Details for
Bug 27680
API DataTables Wrapper fails for ordering on multi-data-field columns
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27680: Allow traditional multi-params to work
Bug-27680-Allow-traditional-multi-params-to-work.patch (text/plain), 1.55 KB, created by
Jonathan Druart
on 2021-03-01 12:19:37 UTC
(
hide
)
Description:
Bug 27680: Allow traditional multi-params to work
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-03-01 12:19:37 UTC
Size:
1.55 KB
patch
obsolete
>From 7b768ba83372eeef566469ca65704be24457fe45 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 12 Feb 2021 19:25:10 +0000 >Subject: [PATCH] Bug 27680: Allow traditional multi-params to work > >This patch allows the preceeding test to pass. Strictly, we want a comma >delimited string for our _order_by parameter, but we cannot easily block >a traditional multi-passed parameter. As such the 'nice' thing to do is >handle it when such a thing is passed as it will pass through validation >regardless. > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > Koha/REST/Plugin/Query.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/Koha/REST/Plugin/Query.pm b/Koha/REST/Plugin/Query.pm >index c7ab65dc5a..93ce2c2c49 100644 >--- a/Koha/REST/Plugin/Query.pm >+++ b/Koha/REST/Plugin/Query.pm >@@ -92,7 +92,7 @@ Generates the DBIC order_by attributes based on I<$params>, and merges into I<$a > > if ( defined $args->{params}->{_order_by} ) { > my $order_by = $args->{params}->{_order_by}; >- $order_by = [ split(/,/, $order_by) ] if ( index(',',$order_by) == -1); >+ $order_by = [ split(/,/, $order_by) ] if ( !reftype($order_by) && index(',',$order_by) == -1); > if ( reftype($order_by) and reftype($order_by) eq 'ARRAY' ) { > my @order_by = map { _build_order_atom({ string => $_, result_set => $result_set }) } > @{ $order_by }; >-- >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 27680
:
116794
|
116795
|
116796
|
116829
|
116831
|
116832
|
116833
|
116834
|
116843
|
116844
|
116845
|
116846
|
117335
|
117336
|
117337
|
117338
|
117339
|
117340
|
117341
|
117375
|
117388
|
117389
|
117390
|
117391
|
117392
|
117393
|
117394
|
117438
|
117439
|
117440
| 117441 |
117442
|
117476