Bug 11773: fix crash in sco-main.pl if no active currency is set
authorMarc Véron <veron@veron.ch>
Sat, 15 Feb 2014 16:07:55 +0000 (17:07 +0100)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 6 Jun 2014 11:30:16 +0000 (07:30 -0400)
commit2d7362031e9153e8787bee880f8fa61996ede898
treecf72c2dba15bfb8db9bdce363e8bfc03c049e997
parent81ade5377795ad372089d7110e7cc4f4694df747
Bug 11773: fix crash in sco-main.pl if no active currency is set

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 with 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

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 1db56c834b297eb7fd968691f66ef3517771cba5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 0e0b39deafed3376bc65af9bf9ee7ec678c60d35)
opac/sco/sco-main.pl