Bugzilla – Attachment 110581 Details for
Bug 26506
Koha::Account::pay will fail if $userenv is not set
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26506: Fix Koha::Account::pay if called when no user is logged-in
Bug-26506-Fix-KohaAccountpay-if-called-when-no-use.patch (text/plain), 1.32 KB, created by
Magnus Enger
on 2020-09-23 08:39:08 UTC
(
hide
)
Description:
Bug 26506: Fix Koha::Account::pay if called when no user is logged-in
Filename:
MIME Type:
Creator:
Magnus Enger
Created:
2020-09-23 08:39:08 UTC
Size:
1.32 KB
patch
obsolete
>From f7f1055a113f9e3237d5e6184a4573a50bd0e380 Mon Sep 17 00:00:00 2001 >From: Matthias Meusburger <matthias.meusburger@biblibre.com> >Date: Tue, 22 Sep 2020 15:16:23 +0200 >Subject: [PATCH] Bug 26506: Fix Koha::Account::pay if called when no user is > logged-in > >Currently, Koha::Account::pay will fail if no user is logged-in when it is >called. > >In this case, this patch will use undef instead of 0 for $manager_id in order >to comply with the foreign key constraint on manager_id. > >Signed-off-by: Magnus Enger <magnus@libriotech.no> >Biblibre and Libriotech have created a OPAC payment plugin that was >having problems because of this bug. Applying the fix in this patch >to a live server solved the problem. >--- > Koha/Account.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/Koha/Account.pm b/Koha/Account.pm >index 2a63856b52..5178d98639 100644 >--- a/Koha/Account.pm >+++ b/Koha/Account.pm >@@ -95,7 +95,7 @@ sub pay { > > my $patron = Koha::Patrons->find( $self->{patron_id} ); > >- my $manager_id = $userenv ? $userenv->{number} : 0; >+ my $manager_id = $userenv ? $userenv->{number} : undef; > my $interface = $params ? ( $params->{interface} || C4::Context->interface ) : C4::Context->interface; > Koha::Exceptions::Account::RegisterRequired->throw() > if ( C4::Context->preference("UseCashRegisters") >-- >2.17.1
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 26506
:
110552
|
110581
|
111045
|
111046