Bugzilla – Attachment 75603 Details for
Bug 20763
AllowPurchaseSuggestionBranchChoice triggers error opac-suggestions.pl is visited without logging in
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20763: Remove unecessary Koha::Patron fetch
Bug-20763-Remove-unecessary-KohaPatron-fetch.patch (text/plain), 1.21 KB, created by
Jonathan Druart
on 2018-05-28 19:38:18 UTC
(
hide
)
Description:
Bug 20763: Remove unecessary Koha::Patron fetch
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2018-05-28 19:38:18 UTC
Size:
1.21 KB
patch
obsolete
>From 2429c40ae1a3baebfa4387e400f4efd136a5c7a4 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 28 May 2018 16:36:54 -0300 >Subject: [PATCH] Bug 20763: Remove unecessary Koha::Patron fetch > >If $borrowernumber is not set, there is no userenv. >So let's pick the library code set in the userenv instead of fetching >the Koha::Patron->branchcode from DB > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > opac/opac-suggestions.pl | 7 +------ > 1 file changed, 1 insertion(+), 6 deletions(-) > >diff --git a/opac/opac-suggestions.pl b/opac/opac-suggestions.pl >index c29278cf89..19493aae99 100755 >--- a/opac/opac-suggestions.pl >+++ b/opac/opac-suggestions.pl >@@ -198,12 +198,7 @@ my $patron_reason_loop = GetAuthorisedValues("OPAC_SUG"); > if ( C4::Context->preference("AllowPurchaseSuggestionBranchChoice") ) { > my $branchcode = $input->param('branchcode') || q{}; > >- if ( !$branchcode && $borrowernumber ) { >- my $patron = Koha::Patrons->find($borrowernumber); >- $branchcode = $patron->branchcode; >- } >- >- if ( !$branchcode >+ if ( !$branchcode > && C4::Context->userenv > && C4::Context->userenv->{branch} ) > { >-- >2.11.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 20763
:
75302
|
75567
|
75602
|
75603
|
75623