Bugzilla – Attachment 111045 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.38 KB, created by
Martin Renvoize (ashimema)
on 2020-10-01 13:34:58 UTC
(
hide
)
Description:
Bug 26506: Fix Koha::Account::pay if called when no user is logged-in
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-10-01 13:34:58 UTC
Size:
1.38 KB
patch
obsolete
>From bc0f4c970cb1d6f4fbe1c6ee2bfba2a931ded2c5 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. >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > 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.20.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