Fix for Bug 6487 - No error explanation if patron expiration date is missing

The script tries to parse the patron expiration date without
checking that it is a valid date. If expiration date is empty
it doesn't get caught along with past expiration dates.

I wonder if this line was supposed to catch this problem:

Line 233: if ( $warning_year*$warning_month*$warning_day==0

This patch adds "!$borrower->{'dateexpiry'} ||" to that line.

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
This commit is contained in:
Owen Leonard 2011-06-08 10:07:32 -04:00 committed by Chris Cormack
parent 716442708b
commit 84a8c9a522
2 changed files with 3 additions and 3 deletions

View file

@ -230,7 +230,7 @@ if ($borrowernumber) {
0 , $borrower->{'enrolmentperiod'});
}
# if the expiry date is before today ie they have expired
if ( $warning_year*$warning_month*$warning_day==0
if ( !$borrower->{'dateexpiry'} || $warning_year*$warning_month*$warning_day==0
|| Date_to_Days($today_year, $today_month, $today_day )
> Date_to_Days($warning_year, $warning_month, $warning_day) )
{
@ -238,7 +238,7 @@ if ($borrowernumber) {
$template->param(
flagged => "1",
noissues => "1",
expired => format_date($borrower->{dateexpiry}),
expired => "1",
renewaldate => format_date("$renew_year-$renew_month-$renew_day")
);
}

View file

@ -554,7 +554,7 @@ No patron matched <span class="ex">[% message %]</span>
[% IF ( expired ) %]
<li><span class="circ-hlt">Expiration:</span> Patron's card has expired.
Patron's card expired on [% expiry %] <a href="/cgi-bin/koha/members/setstatus.pl?borrowernumber=[% borrowernumber %]&amp;cardnumber=[% cardnumber %]&amp;destination=circ&amp;reregistration=y">Renew</a> or <a href="/cgi-bin/koha/members/memberentry.pl?op=modify&amp;destination=circ&amp;borrowernumber=[% borrowernumber %]&amp;categorycode=[% categorycode %]">Edit Details</a>
[% IF ( expiry ) %]Patron's card expired on [% expiry %][% END %] <a href="/cgi-bin/koha/members/setstatus.pl?borrowernumber=[% borrowernumber %]&amp;cardnumber=[% cardnumber %]&amp;destination=circ&amp;reregistration=y">Renew</a> or <a href="/cgi-bin/koha/members/memberentry.pl?op=modify&amp;destination=circ&amp;borrowernumber=[% borrowernumber %]&amp;categorycode=[% categorycode %]">Edit Details</a>
</li>
[% END %]