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

Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Jonathan Druart 2022-04-21 11:41:55 +02:00 committed by Martin Renvoize
parent 11a485c544
commit 4023704463
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
1 changed files with 1 additions and 1 deletions

View File

@ -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} );