Bug 11773 - Crash 'undefined value as a HASH' in sco-main.pl
Summary: Crash 'undefined value as a HASH' in sco-main.pl
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Self checkout (show other bugs)
Version: master
Hardware: All All
: P3 normal (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-15 15:49 UTC by Marc Véron
Modified: 2015-06-04 23:30 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 11773 - Crash 'undefined value as a HASH' in sco-main.pl (2.66 KB, patch)
2014-02-15 16:23 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 11773 - Crash 'undefined value as a HASH' in sco-main.pl (2.71 KB, patch)
2014-02-16 05:25 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 11773 - Crash 'undefined value as a HASH' in sco-main.pl (2.79 KB, patch)
2014-02-17 11:10 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Véron 2014-02-15 15:49:11 UTC
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.
Comment 1 Marc Véron 2014-02-15 16:23:20 UTC Comment hidden (obsolete)
Comment 2 Chris Cormack 2014-02-16 05:25:21 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2014-02-17 11:10:09 UTC
Created attachment 25344 [details] [review]
Bug 11773 - Crash 'undefined value as a HASH' in sco-main.pl

    Bug 11773 - Crash 'undefined value as a HASH' in sco-main.pl

    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

    Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
    Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 4 Galen Charlton 2014-02-18 21:05:50 UTC
Pushed to master.  Thanks, Marc!
Comment 5 Fridolin Somers 2014-05-19 14:19:18 UTC
Pushed to 3.14.x, will be in 3.14.07
Comment 6 Kyle M Hall 2014-06-06 13:51:11 UTC
Pushed to 3.12.x will be in 3.12.13