<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hm, I don't remember a special use case for 0000-00-00. <br>
</p>
<p>My impression was that it is impossible to have a patron without
a valid dateexpiry date.<br>
</p>
<div class="moz-cite-prefix">On 06.02.2018 17:10, Jonathan Druart
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAJzKNY5nDQwQS=DnMZ79A12gq3oRcO0WuGb7ZAoaCX1cz9TVAw@mail.gmail.com">
<div dir="ltr">
<div>
<div>
<div>
<div>Hi devs,<br>
<br>
</div>
I have just caught that:<br>
<br>
</div>
Koha::Patron->is_expired returns 0 if
$self->dateexpiry eq '0000-00-00'<br>
</div>
And there is a test I wrote for it on bug 17578 (commit
5a0a2ce584dec74808f471b0f92b2114c3d6029e , GetMemberDetails -
Remove is_expired)<br>
</div>
<div><br>
</div>
<div>But then we also have, in C4::Circulation::CanBookBeIssued:<br>
752 if ( !defined $patron->dateexpiry ||
$patron->dateexpiry eq '0000-00-00') {<br>
753 $issuingimpossible{EXPIRED} = 1;<br>
754 } else {<br>
</div>
<div>With a test:<br>
is( $issuingimpossible->{EXPIRED}, 1, 'The patron should be
considered as expired if dateexpiry is 0000-00-00' );<br>
<br>
</div>
<div>So, my questions, do you have a very old Koha installations
to search if there is borrowers.is_expired == "0000-00-00" in
it?<br>
</div>
<div>Do you remember if it meant expired or not at some point?<br>
<br>
</div>
<div>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.<br>
<br>
</div>
<div>Cheers,<br>
</div>
<div>Jonathan<br>
</div>
<div><br>
</div>
<div>(yes, the same code should be used)<br>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Koha-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Koha-devel@lists.koha-community.org">Koha-devel@lists.koha-community.org</a>
<a class="moz-txt-link-freetext" href="http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel">http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel</a>
website : <a class="moz-txt-link-freetext" href="http://www.koha-community.org/">http://www.koha-community.org/</a>
git : <a class="moz-txt-link-freetext" href="http://git.koha-community.org/">http://git.koha-community.org/</a>
bugs : <a class="moz-txt-link-freetext" href="http://bugs.koha-community.org/">http://bugs.koha-community.org/</a></pre>
</blockquote>
<br>
</body>
</html>