Bugzilla – Attachment 49896 Details for
Bug 16198
Opac suggestions are broken if user is not logged in
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16198: Fix regression in OPAC suggestions
Bug-16198-Fix-regression-in-OPAC-suggestions.patch (text/plain), 1.61 KB, created by
Jonathan Druart
on 2016-04-05 07:40:49 UTC
(
hide
)
Description:
Bug 16198: Fix regression in OPAC suggestions
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-04-05 07:40:49 UTC
Size:
1.61 KB
patch
obsolete
>From 7185a0d5df2a3d50183f62740533f57e138ee0da Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 5 Apr 2016 08:27:46 +0100 >Subject: [PATCH] Bug 16198: Fix regression in OPAC suggestions > >Introduced by > commit d564d3732d95455b4626dfa8ca711cd658003c17 > Bug 15629: Koha::Libraries - Remove GetBranchInfo > >If the branchcodesuggestedby is not defined, the find won't return >anything and ->branchname on an undefined value will raise > Can't call method "branchname" on an undefined value at > /home/katrin/kohaclone/opac/opac-suggestions.pl line 153. > >Test plan: >-Staff >Create a patron >Use this patron to create a suggestion >Delete the patron > >-OPAC >Logout and trigger opac/opac-suggestions.pl > >Without this patch, you will get an error >With this patch applied, everything should be ok >--- > opac/opac-suggestions.pl | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > >diff --git a/opac/opac-suggestions.pl b/opac/opac-suggestions.pl >index 46a5f1b..7c17d5a 100755 >--- a/opac/opac-suggestions.pl >+++ b/opac/opac-suggestions.pl >@@ -150,7 +150,12 @@ if ( $op eq "delete_confirm" ) { > print $input->redirect("/cgi-bin/koha/opac-suggestions.pl?op=else"); > exit; > } >-map{ $_->{'branchcodesuggestedby'} = Koha::Libraries->find($_->{'branchcodesuggestedby'})->branchname} @$suggestions_loop; >+ >+map{ >+ my $s = $_; >+ my $library = Koha::Libraries->find($s->{branchcodesuggestedby}); >+ $library ? $s->{branchcodesuggestedby} = $library->branchname : () >+} @$suggestions_loop; > > foreach my $suggestion(@$suggestions_loop) { > if($suggestion->{'suggestedby'} == $borrowernumber) { >-- >2.7.0
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 16198
:
49896
|
49904
|
49933