Bugzilla – Attachment 97426 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 Koha::Objects->from_api_mapping instead of attributes_from_api to get the column name in Koha::REST::Plugins::Query->_build_order_atom
Bug-24432-Use-KohaObjects-fromapimapping-instead-o.patch (text/plain), 1.09 KB, created by
Agustín Moyano
on 2020-01-15 23:18:42 UTC
(
hide
)
Description:
Bug 24432: Use Koha::Objects->from_api_mapping instead of attributes_from_api to get the column name in Koha::REST::Plugins::Query->_build_order_atom
Filename:
MIME Type:
Creator:
Agustín Moyano
Created:
2020-01-15 23:18:42 UTC
Size:
1.09 KB
patch
obsolete
>From 6becfa25a0ac1795226f5d5bd5d8acdf361da5f0 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 Koha::Objects->from_api_mapping instead of > attributes_from_api to get the column name in > Koha::REST::Plugins::Query->_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 >--- > 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.17.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 24432
:
97421
|
97424
|
97425
|
97426
|
97528
|
97529
|
97530
|
97660
|
97661
|
97662