Bugzilla – Attachment 58182 Details for
Bug 17764
OPAC search fails when lost items are in the result set and there is no logged in user
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17764: (bug 17556 follow-up) Fix search for logged out users and lost items
Bug-17764-bug-17556-follow-up-Fix-search-for-logge.patch (text/plain), 1.35 KB, created by
Jonathan Druart
on 2016-12-14 17:10:16 UTC
(
hide
)
Description:
Bug 17764: (bug 17556 follow-up) Fix search for logged out users and lost items
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-12-14 17:10:16 UTC
Size:
1.35 KB
patch
obsolete
>From c1a291565fcf4747ff3d81025495814d213a865c Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 13 Dec 2016 12:28:35 +0000 >Subject: [PATCH] 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 >--- > C4/Search.pm | 1 + > 1 file changed, 1 insertion(+) > >diff --git a/C4/Search.pm b/C4/Search.pm >index 4d89d23..4270c82 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -2090,6 +2090,7 @@ sub searchResults { > my $userenv = C4::Context->userenv; > if ( $item->{onloan} > && $userenv >+ && $userenv->{number} > && !( Koha::Patrons->find($userenv->{number})->category->hidelostitems && $item->{itemlost} ) ) > { > $onloan_count++; >-- >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 17764
:
58182
|
58188
|
58261