Bug 19564: Fix extraction of sort order from sort condition name

Currently sort order is extracted from sort condition by splitting the
field, instead use regular expression to extract the last part preceded
by underscore.

Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
David Gustafsson 2017-11-02 15:02:23 +01:00 committed by Nick Clemens
parent 16dfb0309b
commit ecadc62eb4
1 changed files with 1 additions and 1 deletions

View File

@ -491,7 +491,7 @@ sub _convert_sort_fields {
# Convert the fields and orders, drop anything we don't know about.
grep { $_->{field} } map {
my ( $f, $d ) = split /_/;
my ( $f, $d ) = /(.+)_(.+)/;
{
field => $sort_field_convert{$f},
direction => $sort_order_convert{$d}