[Koha-devel] 0000-00-00 is expired?

Jonathan Druart jonathan.druart at bugs.koha-community.org
Tue Feb 6 17:10:44 CET 2018


Hi devs,

I have just caught that:

Koha::Patron->is_expired returns  0 if $self->dateexpiry eq '0000-00-00'
And there is a test I wrote for it on bug 17578 (commit
5a0a2ce584dec74808f471b0f92b2114c3d6029e , GetMemberDetails - Remove
is_expired)

But then we also have, in C4::Circulation::CanBookBeIssued:
 752     if ( !defined $patron->dateexpiry || $patron->dateexpiry eq
'0000-00-00') {
 753         $issuingimpossible{EXPIRED} = 1;
 754     } else {
With a test:
is( $issuingimpossible->{EXPIRED}, 1, 'The patron should be considered as
expired if dateexpiry is 0000-00-00' );

So, my questions, do you have a very old Koha installations to search if
there is borrowers.is_expired == "0000-00-00" in it?
Do you remember if it meant expired or not at some point?

I am trying to adapt our code to sql strict modes, and this value is no
longer valid, we will need to update existing values.

Cheers,
Jonathan

(yes, the same code should be used)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.koha-community.org/pipermail/koha-devel/attachments/20180206/592f133a/attachment.html>


More information about the Koha-devel mailing list