Lines 168-175
sub anonymise_issue_history {
Link Here
|
168 |
# The anonymisation should not fail quietly if AnonymousPatron is not a valid entry |
168 |
# The anonymisation should not fail quietly if AnonymousPatron is not a valid entry |
169 |
# Set it to undef (NULL) |
169 |
# Set it to undef (NULL) |
170 |
my $dtf = Koha::Database->new->schema->storage->datetime_parser; |
170 |
my $dtf = Koha::Database->new->schema->storage->datetime_parser; |
171 |
my $old_issues_to_anonymise = $self->search_related( |
171 |
my $nb_rows = 0; |
172 |
'old_issues', |
172 |
while ( my $patron = $self->next ) { |
|
|
173 |
my $old_issues_to_anonymise = $patron->old_checkouts->search( |
173 |
{ |
174 |
{ |
174 |
( |
175 |
( |
175 |
$older_than_date |
176 |
$older_than_date |
Lines 178-186
sub anonymise_issue_history {
Link Here
|
178 |
: () |
179 |
: () |
179 |
) |
180 |
) |
180 |
} |
181 |
} |
181 |
); |
182 |
); |
182 |
my $anonymous_patron = C4::Context->preference('AnonymousPatron') || undef; |
183 |
my $anonymous_patron = C4::Context->preference('AnonymousPatron') || undef; |
183 |
$old_issues_to_anonymise->update( { 'old_issues.borrowernumber' => $anonymous_patron } ); |
184 |
$nb_rows += $old_issues_to_anonymise->update( { 'old_issues.borrowernumber' => $anonymous_patron } ); |
|
|
185 |
} |
186 |
return $nb_rows; |
184 |
} |
187 |
} |
185 |
|
188 |
|
186 |
=head3 type |
189 |
=head3 type |
187 |
- |
|
|