]> git.koha-community.org Git - koha.git/commit
Bug 6840 warning in logs
authorPaul Poulain <paul.poulain@biblibre.com>
Fri, 2 Sep 2011 16:39:53 +0000 (18:39 +0200)
committerChris Nighswonger <chris.nighswonger@gmail.com>
Wed, 19 Oct 2011 19:56:01 +0000 (15:56 -0400)
commit9de80e949c9b892ce382d19c5b481c6fdf33a423
tree3852b5c7213921a316372dc5e0d6290cfa50a0c6
parent6591d95ddde49f7d1e6512f2b2b504676cdb2cf0
Bug 6840 warning in logs

In staff interface, in search (catalogue/search.pl), there is a warning saying:
[Fri Sep  2 18:20:24 2011] search.pl: Use of uninitialized value $key in hash
element at /home/paul/koha.dev/koha-community/C4/Templates.pm line 227.

The problem happens when searching from the quick search toolbar, not when you
search from advanced search.
Investigating, it seems it's because the sort_by is not defined in this case.

This patch
* fixes the problem in Search.pl by setting the parameter only if there is a sort_by field
* modify te Template->param sub to get a better error message. Instead of having just "use of uninitia..." get the value you try to set to an empty key. Much easier to understand which line causes the problem

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
(cherry picked from commit 37902b25a7aa5c9e1b3f90e8cbb50741b27dae1d)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
C4/Templates.pm
catalogue/search.pl