Bugzilla – Attachment 97530 Details for
Bug 24432
order_by broken for date columns
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24432: Use from_api_mapping to translate column name in _build_order_atom
Bug-24432-Use-fromapimapping-to-translate-column-n.patch (text/plain), 1.07 KB, created by
Tomás Cohen Arazi (tcohen)
on 2020-01-17 14:37:10 UTC
(
hide
)
Description:
Bug 24432: Use from_api_mapping to translate column name in _build_order_atom
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2020-01-17 14:37:10 UTC
Size:
1.07 KB
patch
obsolete
>From 02513636b107d245a56e3f97785b6a421b61d5bb Mon Sep 17 00:00:00 2001 >From: Agustin Moyano <agustinmoyano@theke.io> >Date: Wed, 15 Jan 2020 20:12:19 -0300 >Subject: [PATCH] Bug 24432: Use from_api_mapping to translate column name in > _build_order_atom > >Use the mapping instead of building a fake hash only to get the key name. > >To test: >1. apply this patch >2. prove t/Koha/REST/Plugin/Query.t >3. sign off > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/REST/Plugin/Query.pm | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > >diff --git a/Koha/REST/Plugin/Query.pm b/Koha/REST/Plugin/Query.pm >index 3317348a58..b2ebd8f77a 100644 >--- a/Koha/REST/Plugin/Query.pm >+++ b/Koha/REST/Plugin/Query.pm >@@ -220,7 +220,8 @@ sub _build_order_atom { > my $param = $string; > $param =~ s/^(\+|\-|\s)//; > if ( $result_set ) { >- $param = (keys %{$result_set->attributes_from_api({ $param => 1 })})[0]; >+ my $model_param = $result_set->from_api_mapping->{$param}; >+ $param = $model_param if defined $model_param; > } > > if ( $string =~ m/^\+/ or >-- >2.25.0
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 24432
:
97421
|
97424
|
97425
|
97426
|
97528
|
97529
|
97530
|
97660
|
97661
|
97662