From 906c9166a7c63a4086116ce8711610f2448d2ff3 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Mon, 16 Oct 2017 13:08:22 +0200 Subject: [PATCH] Bug 19454: (follow-up) Add a total line when updating Test plan: [1] Run the script with -doit and -cat [some_category] and verify that the printed total is correct. Signed-off-by: Marcel de Rooy Signed-off-by: Charles Farmer Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart --- misc/maintenance/borrowers-force-messaging-defaults.pl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/misc/maintenance/borrowers-force-messaging-defaults.pl b/misc/maintenance/borrowers-force-messaging-defaults.pl index 897f5dfcbc..e327834be9 100755 --- a/misc/maintenance/borrowers-force-messaging-defaults.pl +++ b/misc/maintenance/borrowers-force-messaging-defaults.pl @@ -60,6 +60,7 @@ WHERE bo.dateenrolled >= ?|; $sql .= " AND categorycode = ?" if $category; my $sth = $dbh->prepare($sql); $sth->execute($since, $category || () ); + my $cnt = 0; while ( my ($borrowernumber, $categorycode) = $sth->fetchrow ) { print "$borrowernumber: $categorycode\n"; next unless $doit; @@ -67,8 +68,10 @@ WHERE bo.dateenrolled >= ?|; borrowernumber => $borrowernumber, categorycode => $categorycode, } ); + $cnt++; } $dbh->commit(); + print "Total borrowers updated: $cnt\n" if $doit; } -- 2.39.5