Browse Source

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.

Signed-off-by: David Bourgault <david.bourgault@inlibro.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
17.11.x
Marc Véron 7 years ago
committed by Jonathan Druart
parent
commit
7211fd22ba
  1. 8
      admin/aqbudgetperiods.pl
  2. 8
      admin/aqbudgets.pl
  3. 8
      admin/aqplan.pl

8
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' ) {

8
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';

8
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;

Loading…
Cancel
Save