Bug 37182 - 'datetime' field lost on pseudonymization
Summary: 'datetime' field lost on pseudonymization
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Transaction logs (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal
Assignee: Tomás Cohen Arazi
QA Contact: Testopia
URL:
Keywords:
Depends on: 34611
Blocks:
  Show dependency treegraph
 
Reported: 2024-06-25 14:23 UTC by Tomás Cohen Arazi
Modified: 2024-07-29 04:59 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes a regression where the datetime field was lost when using the pseudonymization command line script added in Koha 24.05 (misc/maintenance/pseudonymize_statistics.pl, see bug 34611). It also adds new tests.
Version(s) released in:
24.11.00,24.05.02
Circulation function:


Attachments
Bug 37182: Regression tests (5.75 KB, patch)
2024-06-25 18:05 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 37182: Make Koha::Statistic->new preserve 'datetime' if passed (1.49 KB, patch)
2024-06-25 18:05 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 37182: Regression tests (5.81 KB, patch)
2024-06-26 00:52 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 37182: Make Koha::Statistic->new preserve 'datetime' if passed (1.55 KB, patch)
2024-06-26 00:52 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi 2024-06-25 14:23:01 UTC

    
Comment 1 Tomás Cohen Arazi 2024-06-25 18:05:21 UTC
Created attachment 168094 [details] [review]
Bug 37182: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 2 Tomás Cohen Arazi 2024-06-25 18:05:24 UTC
Created attachment 168095 [details] [review]
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
Comment 3 Nick Clemens (kidclamp) 2024-06-26 00:52:48 UTC
Created attachment 168114 [details] [review]
Bug 37182: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 4 Nick Clemens (kidclamp) 2024-06-26 00:52:50 UTC
Created attachment 168115 [details] [review]
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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 5 Nick Clemens (kidclamp) 2024-06-26 00:53:26 UTC
Straightforward and covered by tests, straight to PQA
Comment 6 Katrin Fischer 2024-06-27 09:53:12 UTC
Pushed for 24.11!

Well done everyone, thank you!
Comment 7 Lucas Gass 2024-07-18 20:32:34 UTC
Backported to 24.05.x for upcoming 24.05.02
Comment 8 Fridolin Somers 2024-07-19 09:44:26 UTC
Depends on Bug 34611 not in 23.11.x
Comment 9 David Nind 2024-07-29 04:59:52 UTC
No change to the manual required - fixing a regression.