See bug http://lists.koha-community.org/pipermail/koha-devel/2018-February/044322.html 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?
Created attachment 71633 [details] [review] Bug 20145: Do not insert 0000-00-00 in patron tests (and more) We should call Koha::Patron->is_expired in CanBookBeIssued instead of doing the same calculation. Tests have been adapted to pass with new SQL modes. We should not need to update the values in DB, we already have Bug 14717: Prevent 0000-00-00 dates in patron data (3.21.00.023) Test plan: prove t/db_dependent/Circulation/dateexpiry.t prove t/db_dependent/Koha/Patrons.t must return green
Created attachment 71859 [details] [review] Bug 20145: Do not insert 0000-00-00 in patron tests (and more) We should call Koha::Patron->is_expired in CanBookBeIssued instead of doing the same calculation. Tests have been adapted to pass with new SQL modes. We should not need to update the values in DB, we already have Bug 14717: Prevent 0000-00-00 dates in patron data (3.21.00.023) Test plan: prove t/db_dependent/Circulation/dateexpiry.t prove t/db_dependent/Koha/Patrons.t must return green Signed-off-by: Roch D'Amour <roch.damour@inlibro.com>
Created attachment 71897 [details] [review] Bug 20145: Do not insert 0000-00-00 in patron tests (and more) We should call Koha::Patron->is_expired in CanBookBeIssued instead of doing the same calculation. Tests have been adapted to pass with new SQL modes. We should not need to update the values in DB, we already have Bug 14717: Prevent 0000-00-00 dates in patron data (3.21.00.023) Test plan: prove t/db_dependent/Circulation/dateexpiry.t prove t/db_dependent/Koha/Patrons.t must return green Signed-off-by: Roch D'Amour <roch.damour@inlibro.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Pushed to master for 18.05, thanks to everybody involved!
Awsome work all! Pushed to stable for 17.11.04
Pushed to 17.05.x for v17.05.10 In order to apply I added in C4/Circulation.pm (exists in 17.11) : # # BORROWER STATUS # + my $patron = Koha::Patrons->find( $borrower->{borrowernumber} );