@@ -, +, @@ _build_order_atom --- Koha/REST/Plugin/Query.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/Koha/REST/Plugin/Query.pm +++ a/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 --