Bugzilla – Attachment 58382 Details for
Bug 16951
Item search sorting not working properly for most columns
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16951: Replace some more
Bug-16951-Replace-some-more.patch (text/plain), 2.88 KB, created by
Katrin Fischer
on 2016-12-22 13:01:14 UTC
(
hide
)
Description:
Bug 16951: Replace some more
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2016-12-22 13:01:14 UTC
Size:
2.88 KB
patch
obsolete
>From 293bef8743ad2675c41f6dc2d5193ef75465fe54 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 15 Dec 2016 13:50:42 +0100 >Subject: [PATCH] Bug 16951: Replace some more > >In order to avoid warnings in the logs, $cgi->param should be forced to >scalar context > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > catalogue/itemsearch.pl | 17 +++++++++-------- > 1 file changed, 9 insertions(+), 8 deletions(-) > >diff --git a/catalogue/itemsearch.pl b/catalogue/itemsearch.pl >index 49e56ee..fa6b357 100755 >--- a/catalogue/itemsearch.pl >+++ b/catalogue/itemsearch.pl >@@ -42,18 +42,19 @@ if (defined $format and $format eq 'json') { > $content_type = 'json'; > > # Map DataTables parameters with 'regular' parameters >- $cgi->param('rows', $cgi->param('iDisplayLength')); >- $cgi->param('page', ($cgi->param('iDisplayStart') / $cgi->param('iDisplayLength')) + 1); >+ $cgi->param('rows', scalar $cgi->param('iDisplayLength')); >+ $cgi->param('page', (scalar $cgi->param('iDisplayStart') / scalar $cgi->param('iDisplayLength')) + 1); > my @columns = split /,/, scalar $cgi->param('sColumns'); >- $cgi->param('sortby', $columns[ $cgi->param('iSortCol_0') ]); >- $cgi->param('sortorder', $cgi->param('sSortDir_0')); >+ $cgi->param('sortby', $columns[ scalar $cgi->param('iSortCol_0') ]); >+ $cgi->param('sortorder', scalar $cgi->param('sSortDir_0')); > > my @f = $cgi->multi_param('f'); > my @q = $cgi->multi_param('q'); > push @q, '' if @q == 0; > my @op = $cgi->multi_param('op'); > my @c = $cgi->multi_param('c'); >- foreach my $i (0 .. ($cgi->param('iColumns') - 1)) { >+ my $iColumns = $cgi->param('iColumns'); >+ foreach my $i (0 .. ($iColumns - 1)) { > my $sSearch = $cgi->param("sSearch_$i"); > if (defined $sSearch and $sSearch ne '') { > my @words = split /\s+/, $sSearch; >@@ -109,7 +110,7 @@ if (scalar keys %params > 0) { > field => $p, > query => \@q, > }; >- if (my $op = $cgi->param($p . '_op')) { >+ if (my $op = scalar $cgi->param($p . '_op')) { > $f->{operator} = $op; > } > push @{ $filter->{filters} }, $f; >@@ -170,14 +171,14 @@ if (scalar keys %params > 0) { > } > } > >- if (my $itemcallnumber_from = $cgi->param('itemcallnumber_from')) { >+ if (my $itemcallnumber_from = scalar $cgi->param('itemcallnumber_from')) { > push @{ $filter->{filters} }, { > field => 'itemcallnumber', > query => $itemcallnumber_from, > operator => '>=', > }; > } >- if (my $itemcallnumber_to = $cgi->param('itemcallnumber_to')) { >+ if (my $itemcallnumber_to = scalar $cgi->param('itemcallnumber_to')) { > push @{ $filter->{filters} }, { > field => 'itemcallnumber', > query => $itemcallnumber_to, >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 16951
:
58243
|
58244
|
58381
|
58382
|
58384
|
58385