7453 Followup for borrower without expiry date
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Thu, 23 Feb 2012 08:46:32 +0000 (09:46 +0100)
committerPaul Poulain <paul.poulain@biblibre.com>
Mon, 27 Feb 2012 10:34:51 +0000 (11:34 +0100)
While it should be impossible now to have a patron without expiry date, I still had one. It does not hurt to add a simple check on expiry date defined before calling delta days on null values and breaking the opac login.
Trivial change.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tested by deleting the expirydate from my own patron record.
Missing expiry date now no longer breaks the summary page
in the patron account on OPAC.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
opac/opac-user.pl

index f6ed484..4485ad6 100755 (executable)
@@ -121,7 +121,7 @@ my @bordat;
 $bordat[0] = $borr;
 
 # Warningdate is the date that the warning starts appearing
-if ( C4::Context->preference('NotifyBorrowerDeparture') &&
+if ( $borr->{dateexpiry} && C4::Context->preference('NotifyBorrowerDeparture') &&
     Date_to_Days(Add_Delta_Days($warning_year,$warning_month,$warning_day,- C4::Context->preference('NotifyBorrowerDeparture'))) <
     Date_to_Days( $today_year, $today_month, $today_day ) ) 
 {