Lines 168-176
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 $anonymous_patron = C4::Context->preference('AnonymousPatron') || undef; |
172 |
'old_issues', |
172 |
Koha::Old::Checkouts->search( |
173 |
{ |
173 |
{ |
|
|
174 |
borrowernumber => { in => [ $self->get_column('borrowernumber') ] }, |
174 |
( |
175 |
( |
175 |
$older_than_date |
176 |
$older_than_date |
176 |
? ( returndate => |
177 |
? ( returndate => |
Lines 178-186
sub anonymise_issue_history {
Link Here
|
178 |
: () |
179 |
: () |
179 |
) |
180 |
) |
180 |
} |
181 |
} |
181 |
); |
182 |
)->update( { 'old_issues.borrowernumber' => $anonymous_patron } ); |
182 |
my $anonymous_patron = C4::Context->preference('AnonymousPatron') || undef; |
|
|
183 |
$old_issues_to_anonymise->update( { 'old_issues.borrowernumber' => $anonymous_patron } ); |
184 |
} |
183 |
} |
185 |
|
184 |
|
186 |
=head3 type |
185 |
=head3 type |
187 |
- |
|
|