Bug 10843: fix crash that can occur when confirming hold if ReservesMaxPickUpDelay...
authorJonathan Druart <jonathan.druart@biblibre.com>
Mon, 9 Sep 2013 12:12:05 +0000 (14:12 +0200)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Tue, 3 Dec 2013 18:42:12 +0000 (15:42 -0300)
commit9a807414d448c9beb9794ad9c0409d67eea9229f
treeddb0e6ed0d58f37c6ed91d0379958e13404e0d1d
parent58d58510d04c58a9b918838d96e1562be16f81ea
Bug 10843: fix crash that can occur when confirming hold if ReservesMaxPickUpDelay is undefined

Test plan:
1) set an empty string for the ReservesMaxPickUpDelay pref
2) place a hold on an item
3) check in the item
4) click on "Print and confirm"
5) an error occurs
> The 'days' parameter (undef) to DateTime::Duration::new was an 'undef'
6) apply the patch
7) repeat steps 1 to 4
8) the error does not occur anymore.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
An empty string didn't do it for me, I had to set the
variable for the systempreference to NULL. I am not sure
if this can happen when editing from the interface, but
this change should not have any ill side effects and it has
unit tests!

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit a9b564678e184b44b4c54d72e21f66efc3810f4e)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Adjusted some bits.
C4/Letters.pm
t/Letters.t