Bugzilla – Attachment 25304 Details for
Bug 11773
Crash 'undefined value as a HASH' in sco-main.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11773 - Crash 'undefined value as a HASH' in sco-main.pl
Bug-11773---Crash-undefined-value-as-a-HASH-in-sco.patch (text/plain), 2.66 KB, created by
Marc Véron
on 2014-02-15 16:23:20 UTC
(
hide
)
Description:
Bug 11773 - Crash 'undefined value as a HASH' in sco-main.pl
Filename:
MIME Type:
Creator:
Marc Véron
Created:
2014-02-15 16:23:20 UTC
Size:
2.66 KB
patch
obsolete
>From da360e1e41d3db5c912651fbccb66d75c14f02ff Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Marc=20V=C3=A9ron?= <veron@veron.ch> >Date: Sat, 15 Feb 2014 17:07:55 +0100 >Subject: [PATCH] Bug 11773 - Crash 'undefined value as a HASH' in sco-main.pl >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >If no currency is defined as active and a patron with debts tries to check out in welf checkout moduel, sco-main.pl crashes with: >Software error: >Can't use an undefined value as a HASH reference at /usr/share/kohaclone/opac/sco/sco-main.pl line 190. > >This patch tests for active currency and simply does not display a currency symbol if appropriate. > >Test plan: > >1) >Make sure you have a patron with debts and no currency defined as active. >(Home ⺠Administration ⺠Currencies & Exchange rates ⺠Currencies ) >2) >Go to Self checkout module and try to checkout an item to this patron >Result: Crash wit error message "Can't use an undefined value as a HASH..." >3) >Apply patch >4) >Reload and try to checkout again >Expected result: Message "You owe the library..." without currency symbol >5) >Define a currency as active and try to checkout again >Expected result: Message "You owe..." with currency symbol >--- > opac/sco/sco-main.pl | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > >diff --git a/opac/sco/sco-main.pl b/opac/sco/sco-main.pl >index d1234a0..14f74b5 100755 >--- a/opac/sco/sco-main.pl >+++ b/opac/sco/sco-main.pl >@@ -111,6 +111,10 @@ if (C4::Context->preference('SelfCheckoutByLogin') && !$patronid) { > } > my $borrower = GetMemberDetails(undef,$patronid); > >+my $currencySymbol = ""; >+if ( defined C4::Budgets->GetCurrency() ) { >+ $currencySymbol = C4::Budgets->GetCurrency()->{symbol}; >+} > > my $branch = $issuer->{branchcode}; > my $confirm_required = 0; >@@ -154,7 +158,7 @@ elsif ( $op eq "checkout" ) { > hide_main => 1, > ); > if ($issue_error eq 'DEBT') { >- $template->param(amount => C4::Budgets->GetCurrency()->{symbol}.$impossible->{DEBT}); >+ $template->param(amount => $currencySymbol.$impossible->{DEBT}); > } > #warn "issue_error: " . $issue_error ; > if ( $issue_error eq "NO_MORE_RENEWALS" ) { >@@ -187,7 +191,7 @@ elsif ( $op eq "checkout" ) { > hide_main => 1, > ); > if ($issue_error eq 'DEBT') { >- $template->param(amount => C4::Budgets->GetCurrency()->{symbol}.$needconfirm->{DEBT}); >+ $template->param(amount => $currencySymbol.$needconfirm->{DEBT}); > } > } else { > if ( $confirmed || $issuenoconfirm ) { # we'll want to call getpatroninfo again to get updated issues. >-- >1.7.10.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 11773
:
25304
|
25311
|
25344