Bugzilla – Attachment 168095 Details for
Bug 37182
'datetime' field lost on pseudonymization
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37182: Make Koha::Statistic->new preserve 'datetime' if passed
Bug-37182-Make-KohaStatistic-new-preserve-datetime.patch (text/plain), 1.49 KB, created by
Tomás Cohen Arazi (tcohen)
on 2024-06-25 18:05:24 UTC
(
hide
)
Description:
Bug 37182: Make Koha::Statistic->new preserve 'datetime' if passed
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2024-06-25 18:05:24 UTC
Size:
1.49 KB
patch
obsolete
>From ded1ff2b1587c78c1d286a065cacddb52cdc7e03 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 25 Jun 2024 15:01:29 -0300 >Subject: [PATCH] Bug 37182: Make Koha::Statistic->new preserve 'datetime' if > passed > >This patch does what the title says. This behavior is tested on the >previous patch. Tests are also added for the background job (which >relies on Koha::Statistic->new and was the evidence of this >overwrite behavior). > >To test: > >1. Apply the regression tests patch >2. Run: > $ ktd --shell > k$ prove t/db_dependent/Koha/Statistic.t \ > t/db_dependent/Koha/BackgroundJob/PseudonymizeStatistic.t >=> FAIL: Tests don't pass :-/ >3. Apply this patch >4. Repeat 2 >=> SUCCESS: Tests pass! >5. Sign off :-D >--- > Koha/Statistic.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/Koha/Statistic.pm b/Koha/Statistic.pm >index 0eb7414c460..14f299569f0 100644 >--- a/Koha/Statistic.pm >+++ b/Koha/Statistic.pm >@@ -90,7 +90,7 @@ sub new { > my @missing = map { exists $params->{$_} ? () : $_ } @mandatory_keys; > Koha::Exceptions::MissingParameter->throw( parameter => join( ',', @missing ) ) if @missing; > >- my $datetime = Koha::Database->new->schema->storage->datetime_parser->format_datetime( dt_from_string() ); >+ my $datetime = $params->{datetime} ? $params->{datetime} : dt_from_string(); > return $class->SUPER::new( > { > borrowernumber => $params->{borrowernumber}, # no longer sending empty string (changed 2023) >-- >2.45.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 37182
:
168094
|
168095
|
168114
|
168115