Line 0
Link Here
|
0 |
- |
1 |
use Modern::Perl; |
|
|
2 |
use Koha::Installer::Output qw(say_warning say_failure say_success say_info); |
3 |
|
4 |
return { |
5 |
bug_number => "36822", |
6 |
description => "Sanitize borrowers.updated_on", |
7 |
up => sub { |
8 |
my ($args) = @_; |
9 |
my ( $dbh, $out ) = @$args{qw(dbh out)}; |
10 |
|
11 |
my $sth = $dbh->prepare( |
12 |
q{ |
13 |
SELECT borrowernumber |
14 |
FROM borrowers |
15 |
WHERE updated_on = '0000-00-00 00:00:00' |
16 |
} |
17 |
); |
18 |
$sth->execute; |
19 |
my $results = $sth->fetchall_arrayref( {} ); |
20 |
|
21 |
if (@$results) { |
22 |
sanitize_zero_date( 'borrowers', 'updated_on' ); |
23 |
say_info( $out, "The following borrowers' updated_on has been sanitized: " |
24 |
. join( ', ', map { $_->{borrowernumber} } @$results ) ); |
25 |
} |
26 |
|
27 |
}, |
28 |
}; |