From 4a6152c781cf433bb1fa27751136995a1fcee73c Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 26 May 2023 08:19:36 +0000 Subject: [PATCH] Bug 33843: Use filter_by_last_update in Koha::Notice::Util Content-Type: text/plain; charset=utf-8 Resolve FIXME in sub _get_domain_count by using new datetime parameter from bug 33837. Test plan: Run t/db_dependent/Koha/Notice_Util.t. This triggers the _get_domain_count call using the filter. Signed-off-by: Marcel de Rooy --- Koha/Notice/Util.pm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Koha/Notice/Util.pm b/Koha/Notice/Util.pm index 98f6182cf5..4e515d4b5d 100644 --- a/Koha/Notice/Util.pm +++ b/Koha/Notice/Util.pm @@ -116,15 +116,13 @@ sub _get_domain_count { } keys %$limits; my $sum = 0; - my $dt_parser = Koha::Database->new->schema->storage->datetime_parser; my $start_dt = _convert_unit( undef, $limits->{$group}->{unit} ); foreach my $domain ( @domains ) { $sum += Koha::Notice::Messages->search({ message_transport_type => 'email', status => 'sent', to_address => { 'LIKE', '%'.$domain }, - updated_on => { '>=', $dt_parser->format_datetime($start_dt) }, # FIXME Would be nice if possible via filter_by_last_update - })->count; + })->filter_by_last_update({ timestamp_column_name => 'updated_on', from => $start_dt, datetime => 1 })->count; } $limits->{$group}->{count} = $sum; } -- 2.30.2