Bugzilla – Attachment 67179 Details for
Bug 19328
Internal server error because of missing currency
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19328 - Internal server error because of missing currency
Bug-19328---Internal-server-error-because-of-missi.patch (text/plain), 3.16 KB, created by
Marc Véron
on 2017-09-17 10:04:44 UTC
(
hide
)
Description:
Bug 19328 - Internal server error because of missing currency
Filename:
MIME Type:
Creator:
Marc Véron
Created:
2017-09-17 10:04:44 UTC
Size:
3.16 KB
patch
obsolete
>From 2dc8127c95c282e5c86d1dcf2300cfb7283affd0 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Marc=20V=C3=A9ron?= <veron@veron.ch> >Date: Sun, 17 Sep 2017 11:53:34 +0200 >Subject: [PATCH] Bug 19328 - Internal server error because of missing currency > >This patch fixes internal server errors because of missing active currency >in files aqbudgetperiods.pl, aqbudgets.pl and aqplan.pl. > >To reproduce: >- Make sure that no active currency is defined. You can undefine the active > currency in Administration->Currencies and exchange rates >- Try to go to Administration->Budgets and Admistration->Funds >Result: Internal server error > >To test: >- Apply patch >- Restart plack >- Try to reproduce issue, it should no longer occur. There should be a > yellow message box "No active currency is defined" >- From Administration-> Budgets administration try to edit a fund and go to > "Planning". Verify that the message box appears here as well. >--- > admin/aqbudgetperiods.pl | 8 +++++--- > admin/aqbudgets.pl | 8 +++++--- > admin/aqplan.pl | 8 +++++--- > 3 files changed, 15 insertions(+), 9 deletions(-) > >diff --git a/admin/aqbudgetperiods.pl b/admin/aqbudgetperiods.pl >index fbe1938..0a05a55 100755 >--- a/admin/aqbudgetperiods.pl >+++ b/admin/aqbudgetperiods.pl >@@ -91,9 +91,11 @@ my ($template, $borrowernumber, $cookie, $staff_flags ) = get_template_and_user( > > # This is used in incbudgets-active-currency.inc > my $active_currency = Koha::Acquisition::Currencies->get_active; >-$template->param( symbol => $active_currency->symbol, >- currency => $active_currency->currency >- ); >+if ( $active_currency ) { >+ $template->param( symbol => $active_currency->symbol, >+ currency => $active_currency->currency >+ ); >+} > > # ADD OR MODIFY A BUDGET PERIOD - BUILD SCREEN > if ( $op eq 'add_form' ) { >diff --git a/admin/aqbudgets.pl b/admin/aqbudgets.pl >index 7e85254..f106a86 100755 >--- a/admin/aqbudgets.pl >+++ b/admin/aqbudgets.pl >@@ -50,9 +50,11 @@ my ($template, $borrowernumber, $cookie, $staffflags ) = get_template_and_user( > ); > > my $active_currency = Koha::Acquisition::Currencies->get_active; >-$template->param( symbol => $active_currency->symbol, >- currency => $active_currency->currency >- ); >+if ( $active_currency ) { >+ $template->param( symbol => $active_currency->symbol, >+ currency => $active_currency->currency >+ ); >+} > > my $op = $input->param('op') || 'list'; > >diff --git a/admin/aqplan.pl b/admin/aqplan.pl >index a27fb0a..f96086e 100755 >--- a/admin/aqplan.pl >+++ b/admin/aqplan.pl >@@ -58,9 +58,11 @@ my $budget_period_id = $input->param('budget_period_id'); > my $period = GetBudgetPeriod($budget_period_id); > my $count = GetPeriodsCount(); > my $active_currency = Koha::Acquisition::Currencies->get_active; >-$template->param( symbol => $active_currency->symbol, >- currency => $active_currency->currency, >- ); >+if ( $active_currency ) { >+ $template->param( symbol => $active_currency->symbol, >+ currency => $active_currency->currency, >+ ); >+} > $template->param( period_button_only => 1 ) if $count == 0; > > >-- >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 19328
:
67179
|
67321
|
67922