Bugzilla – Attachment 65550 Details for
Bug 19048
Self checkout: Internal server error in sco-main.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19048: (bug 17829 follow-up) Fix regression in self checkout
Bug-19048-bug-17829-follow-up-Fix-regression-in-se.patch (text/plain), 2.27 KB, created by
Marc Véron
on 2017-08-07 13:41:16 UTC
(
hide
)
Description:
Bug 19048: (bug 17829 follow-up) Fix regression in self checkout
Filename:
MIME Type:
Creator:
Marc Véron
Created:
2017-08-07 13:41:16 UTC
Size:
2.27 KB
patch
obsolete
>From 8e4cc158609cc78e789ff866200bbcbf2dec20b3 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 7 Aug 2017 09:54:27 -0300 >Subject: [PATCH] Bug 19048: (bug 17829 follow-up) Fix regression in self > checkout >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >$patronid is not necessarily set or does not match a valid cardnumber. >These cases must be taken into account to avoid the script to crash and >raise the following error: >Can't call method "unblessed" on an undefined value at >(...)/koha/opac/sco/sco-main.pl line 117 > >Test plan: >Hit sco/sco-main.pl and confirm that the error is gone with this patch >applied > >Signed-off-by: Marc Véron <veron@veron.ch> >--- > opac/sco/sco-main.pl | 13 ++++++++----- > 1 file changed, 8 insertions(+), 5 deletions(-) > >diff --git a/opac/sco/sco-main.pl b/opac/sco/sco-main.pl >index 80ac47d..4020e27 100755 >--- a/opac/sco/sco-main.pl >+++ b/opac/sco/sco-main.pl >@@ -114,7 +114,12 @@ if (C4::Context->preference('SelfCheckoutByLogin') && !$patronid) { > my $resval; > ($resval, $patronid) = checkpw($dbh, $patronlogin, $patronpw); > } >-my $borrower = Koha::Patrons->find( { cardnumber => $patronid } )->unblessed; >+ >+my $borrower; >+if ( $patronid ) { >+ $borrower = Koha::Patrons->find( { cardnumber => $patronid } ); >+ $borrower = $borrower->unblessed if $borrower; >+} > > my $currencySymbol = ""; > if ( my $active_currency = Koha::Acquisition::Currencies->get_active ) { >@@ -131,10 +136,8 @@ if ($op eq "logout") { > } > elsif ( $op eq "returnbook" && $allowselfcheckreturns ) { > my ($doreturn) = AddReturn( $barcode, $branch ); >- #warn "returnbook: " . $doreturn; >- $borrower = Koha::Patrons->find( { cardnumber => $patronid } )->unblessed; > } >-elsif ( $op eq "checkout" ) { >+elsif ( $borrower and $op eq "checkout" ) { > my $impossible = {}; > my $needconfirm = {}; > ( $impossible, $needconfirm ) = CanBookBeIssued( >@@ -250,7 +253,7 @@ elsif ( $op eq "checkout" ) { > } > } # $op > >-if ($borrower->{cardnumber}) { >+if ($borrower) { > # warn "issuer's branchcode: " . $issuer->{branchcode}; > # warn "user's branchcode: " . $borrower->{branchcode}; > my $borrowername = sprintf "%s %s", ($borrower->{firstname} || ''), ($borrower->{surname} || ''); >-- >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 19048
:
65537
|
65547
|
65550
|
65553