From 3d1879161d50cdcdfae52d9d1dcf2ac96842fd59 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Fri, 7 Feb 2020 18:40:33 -0500 Subject: [PATCH] ensure that json_query will produce useful SQL when sorting by an LIA Signed-off-by: Galen Charlton --- Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Search.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Search.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Search.pm index c16a5d38f4..53acda4a22 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Search.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Search.pm @@ -630,6 +630,10 @@ q/order_by clause must be of the long form, like: "type" => "left", "field" =>"lineitem" }; + # and ensure that the aggregate form of the attribute + # value column is included in the order_by + $order_by->{aggregate} = 1; + $order_by->{transform} = 'first'; } } } -- 2.11.0