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

Katrin Fischer katrin.fischer.83 at web.de
Tue Feb 6 22:37:20 CET 2018


Hm, I don't remember a special use case for 0000-00-00.

My impression was that it is impossible to have a patron without a valid 
dateexpiry date.

On 06.02.2018 17:10, Jonathan Druart wrote:
> 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)
>
>
> _______________________________________________
> Koha-devel mailing list
> Koha-devel at lists.koha-community.org
> http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
> website : http://www.koha-community.org/
> git : http://git.koha-community.org/
> bugs : http://bugs.koha-community.org/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.koha-community.org/pipermail/koha-devel/attachments/20180206/e102000f/attachment.html>


More information about the Koha-devel mailing list