Bugzilla – Attachment 87672 Details for
Bug 22675
SCO broken on invalid barcodes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22675: Fix SCO behaviour on non-existent barcodes
Bug-22675-Fix-SCO-behaviour-on-non-existent-barcod.patch (text/plain), 1.50 KB, created by
Tomás Cohen Arazi (tcohen)
on 2019-04-09 19:01:27 UTC
(
hide
)
Description:
Bug 22675: Fix SCO behaviour on non-existent barcodes
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2019-04-09 19:01:27 UTC
Size:
1.50 KB
patch
obsolete
>From a4f52b452b2f1670dbb35ace905072a9b983d0bc Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 9 Apr 2019 15:59:14 -0300 >Subject: [PATCH] Bug 22675: Fix SCO behaviour on non-existent barcodes > >Bug 21206 replaced GetItem for Koha::Items->find, and introduced this >problem. This patch verifies $item is defined before attempting to use >its methods. > >To test: >- Log into SCO >- Type an invalid barcode >=> FAIL: Things explode :-/ >- Apply this patch, reload >- Type an invalid barcode >=> SUCCESS: A nice error message is displayed :-D >- Sign off :-D >--- > opac/sco/sco-main.pl | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > >diff --git a/opac/sco/sco-main.pl b/opac/sco/sco-main.pl >index c78b21cefe..12e1d9b061 100755 >--- a/opac/sco/sco-main.pl >+++ b/opac/sco/sco-main.pl >@@ -158,11 +158,12 @@ elsif ( $patron && ( $op eq 'checkout' || $op eq 'renew' ) ) { > if (scalar keys %$impossible) { > > my $issue_error = (keys %$impossible)[0]; # FIXME This is wrong, we assume only one error and keys are not ordered >+ my $title = ( $item ) ? $item->biblio->title : ''; > > $template->param( > impossible => $issue_error, > "circ_error_$issue_error" => 1, >- title => $item->biblio->title, # FIXME Need to be backport! GetItem did not return the biblio's title >+ title => $title, > hide_main => 1, > ); > if ($issue_error eq 'DEBT') { >-- >2.21.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 22675
:
87672
|
87684
|
87685
|
87702