Bug 16951: Fix Item search sorting

Caused by
  commit ac5a1bfece
    Bug 16154: CGI->multi_param - Manual changes

The change was wrong, we wanted to retrieve a scalar (the string), not
an array.
We want to retrieve a string with the different column' names, not an
array of 1 element.

Test plan:
Launch an item search and play with column sort

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2016-12-15 13:45:22 +01:00 committed by Kyle M Hall
parent 00591b2e09
commit 2184fa6ab1

View file

@ -44,7 +44,7 @@ if (defined $format and $format eq 'json') {
# Map DataTables parameters with 'regular' parameters
$cgi->param('rows', $cgi->param('iDisplayLength'));
$cgi->param('page', ($cgi->param('iDisplayStart') / $cgi->param('iDisplayLength')) + 1);
my @columns = split /,/, $cgi->multi_param('sColumns');
my @columns = split /,/, scalar $cgi->param('sColumns');
$cgi->param('sortby', $columns[ $cgi->param('iSortCol_0') ]);
$cgi->param('sortorder', $cgi->param('sSortDir_0'));