From 37d1be1d3d67d0c0ee5cabd2cb926935cdb0c553 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 21 Apr 2022 11:41:55 +0200 Subject: [PATCH] Bug 28786: Don't set auth_method to NULL in ->anonymize DBI Exception: DBD::mysql::st execute failed: Column 'auth_method' cannot be null caught by t/db_dependent/Koha/Patrons.t --- Koha/Patron.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Koha/Patron.pm b/Koha/Patron.pm index 3a26db0d6a0..c424c30174a 100644 --- a/Koha/Patron.pm +++ b/Koha/Patron.pm @@ -1769,7 +1769,7 @@ sub anonymize { split /\s*\|\s*/, C4::Context->preference('BorrowerMandatoryField') }; $mandatory->{userid} = 1; # needed since sub store does not clear field my @columns = $self->_result->result_source->columns; - @columns = grep { !/borrowernumber|branchcode|categorycode|^date|password|flags|updated_on|lastseen|lang|login_attempts|anonymized/ } @columns; + @columns = grep { !/borrowernumber|branchcode|categorycode|^date|password|flags|updated_on|lastseen|lang|login_attempts|anonymized|auth_method/ } @columns; push @columns, 'dateofbirth'; # add this date back in foreach my $col (@columns) { $self->_anonymize_column($col, $mandatory->{lc $col} ); -- 2.25.1