Bug 26648: Prevent explosion in notices on missing item
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Fri, 9 Oct 2020 15:13:00 +0000 (16:13 +0100)
committerTomas Cohen Arazi <tomascohen@theke.io>
Wed, 12 Oct 2022 12:56:43 +0000 (09:56 -0300)
commit971ad5538c3026e126081376520ccb3b13c12d1c
tree25180c6895620bfb7b7de064fce20e9a36e876d7
parentfdb5275407c3c89875cbe7856b86a7fe3364e386
Bug 26648: Prevent explosion in notices on missing item

The item accessor in Koha::Old::Checkouts could explode given a checkout
where the item had been deleted.

To test
1/ Edit the issueslip notice to output some item details from the
borrowers old checkouts

[% FOREACH old_checkout IN borrower.old_checkouts %]
  [% IF old_checkout.item %]
    [% old_checkout.item.price %]
  [% END %]
[% END %]

2/ Delete the item associated with an old checkout for a test patron
3/ Print the issueslip for the patron
4/ Note a server side error is triggered
5/ Apply the patch
6/ Print the slip again and note the price details for old checkouts are
now displayed
7/ Signoff

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Koha/Old/Checkout.pm