Bugzilla – Attachment 154432 Details for
Bug 33843
Use filter_by_last_update in Koha::Notice::Util
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33843: Use filter_by_last_update in Koha::Notice::Util
Bug-33843-Use-filterbylastupdate-in-KohaNoticeUtil.patch (text/plain), 1.75 KB, created by
David Nind
on 2023-08-15 12:26:48 UTC
(
hide
)
Description:
Bug 33843: Use filter_by_last_update in Koha::Notice::Util
Filename:
MIME Type:
Creator:
David Nind
Created:
2023-08-15 12:26:48 UTC
Size:
1.75 KB
patch
obsolete
>From 481062ef62a0eebc3754557b049a0be6f2425334 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 26 May 2023 08:19:36 +0000 >Subject: [PATCH] Bug 33843: Use filter_by_last_update in Koha::Notice::Util > >Resolve FIXME in sub _get_domain_count by using new logic >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 <m.de.rooy@rijksmuseum.nl> >Signed-off-by: David Nind <david@davidnind.com> >--- > Koha/Notice/Util.pm | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) > >diff --git a/Koha/Notice/Util.pm b/Koha/Notice/Util.pm >index 98f6182cf5..60ffa3dbdb 100644 >--- a/Koha/Notice/Util.pm >+++ b/Koha/Notice/Util.pm >@@ -116,15 +116,15 @@ 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; >+ $sum += Koha::Notice::Messages->search( >+ { >+ message_transport_type => 'email', >+ status => 'sent', >+ to_address => { 'LIKE', '%' . $domain }, >+ } >+ )->filter_by_last_update( { timestamp_column_name => 'updated_on', from => $start_dt } )->count; > } > $limits->{$group}->{count} = $sum; > } >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 33843
:
151725
|
153921
|
153922
|
154432
|
155103