Bug 17764: (bug 17556 follow-up) Fix search for logged out users and lost items
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 13 Dec 2016 12:28:35 +0000 (12:28 +0000)
committerBrendan A Gallagher <brendan@bywatersolutions.com>
Thu, 22 Dec 2016 20:25:05 +0000 (20:25 +0000)
commit8db17f9ecab0ced4276dcc55e9663d6d0a45575a
tree6775c7e6be30c1be244d5b1d4d00531f67ee7ac7
parentc86a9e4d300fe746fe542e38a60148de6501f7a6
Bug 17764: (bug 17556 follow-up) Fix search for logged out users and lost items

If you are non logged-in and you the search result contain lost items,
you will get:
Can't call method "category" on an undefined value at
/home/liz/koha-src/koha/C4/Search.pm line 2091.

This is because bug 17556 assumed that $userenv was not defined when the
user is logged out. Actually it is, with non defined or empty string
values.

Test plan:
Do a search in the opac that would turn up a whole list of results (and
not just that one) with the lost item included.
 => Without this patch you should get an error
 => With this patch applied you should see the search results

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
C4/Search.pm