ensure that json_query will produce useful SQL when sorting by an LIA
authorGalen Charlton <gmc@equinoxinitiative.org>
Fri, 7 Feb 2020 23:40:33 +0000 (18:40 -0500)
committerGalen Charlton <gmc@equinoxinitiative.org>
Fri, 7 Feb 2020 23:40:33 +0000 (18:40 -0500)
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Search.pm

index c16a5d3..53acda4 100644 (file)
@@ -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';
             }
         }
     }