Bug 18022: Fix possible crash if CircAutoPrintQuickSlip=clear screen
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 24 Feb 2017 10:44:23 +0000 (11:44 +0100)
committerKatrin Fischer <katrin.fischer.83@web.de>
Sun, 2 Apr 2017 16:45:41 +0000 (18:45 +0200)
commit34565e7f7d38298d37f449520dd5bc20cec833f8
tree4f2816f9ef4fcf2cb7a960b270babb7490eb1aa0
parente2f860386dd811b2be3b2988b690c2d28d748336
Bug 18022: Fix possible crash if CircAutoPrintQuickSlip=clear screen

If CircAutoPrintQuickSlip is set to clear screen, the $borrowernumber variable
is reset but $borrower.
In 16.11.x and before that causes the app to crash, because
$borrower->{flags} is set to a hashref by GetMemberDetails, if
$borrowernumber is set.

This case is better handled in master (17.05) but side-effects could
happen: if $borrowernumber is reset, $borrower should be reset too.

The way to drive this behaviour is terrible and lot of things should be
done to clean this area. This patch is a quick and easy fix to make it
backportable easily.

Test plan:
On master, no change expected
On 16.11 and before:
0. Set CircAutoPrintQuickSlip=clear screen
1. Create a new patron
2. Set permission for this patron to 'reservesforothers' (or something
else).
3. Go on the circulation tab
4. Do not fill the barcode input and submit
=> Without this patch you will get an error
Can't use string ("64") as a HASH ref while "strict refs"....
=> With this patch apply you will get a blank screen (expected
behaviour).

I would recommend to test this patch with the other value of
CircAutoPrintQuickSlip as well
circ/circulation.pl