]> git.evergreen-ils.org Git - Evergreen.git/commit
LP#1205492: fix crash when attempting to renew deposit & rental loans in OPAC
authorGalen Charlton <gmc@esilibrary.com>
Wed, 24 Aug 2016 15:41:57 +0000 (11:41 -0400)
committerMike Rylander <mrylander@gmail.com>
Wed, 24 Aug 2016 16:50:49 +0000 (12:50 -0400)
commit92deb9cd8aa31f49ab406f776d7a9fcc318d58a1
tree3b113cbca8776f4fce89bc75f3ea6218d498fc91
parent95ea3d5223963777f8d76d11ab0dd7e4eeeeceff
LP#1205492: fix crash when attempting to renew deposit & rental loans in OPAC

This patch fixes a bug where attempting to renew a loan on an item
that requires a deposit or a rental fee can cause an Apache
internal server error.

In particular, this patch supplies descriptions for the following
events:

  ITEM_DEPOSIT_REQUIRED
  ITEM_RENTAL_FEE_REQUIRED
  ITEM_DEPOSIT_PAID

It also normalizes how 'fail_part' is set in the renewal response,
as the payload of an event returned when a renewal fails can
be either a hash or an acp Fieldmapper object depending on the
type of event.  In the former case, attempting to access an
nonexistent ->fail_part method is what causes the crash.

To test
-------
[1] Create an item that requires a deposit or a rental fee
    and check it out.
[2] Attempt to renew the loan in the public catalog. Note
    that an internal server error is returned.
[3] Apply the patch and attept step 2 again. This time, the
    public catalog should display a notification to the patron
    that the renewal cannot take place, rather than crashing.
[4] Set up other situations where a renewal should fail for
    reasons other than a deposit/rental fee being required. Verify
    that appropriate error messages are displayed in the public
    catalog.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/extras/ils_events.xml
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
Open-ILS/src/templates/opac/myopac/circs.tt2