Bug 39652 - Pseudonymized_borrower_attributes causes subsequent pseudonymized_transactions to not be added
Summary: Pseudonymized_borrower_attributes causes subsequent pseudonymized_transaction...
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Pedro Amorim
QA Contact: Nick Clemens (kidclamp)
URL:
Keywords:
Depends on:
Blocks: 37901
  Show dependency treegraph
 
Reported: 2025-04-16 11:03 UTC by Pedro Amorim
Modified: 2025-04-24 17:54 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
25.05.00
Circulation function:


Attachments
Bug 39652: Add tests (2.77 KB, patch)
2025-04-16 11:13 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 39652: store PseudonymizedTransaction before adding related entries (3.34 KB, patch)
2025-04-16 11:46 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 39652: Rename new_from_statistic (5.38 KB, patch)
2025-04-17 15:56 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 39652: Rename new_from_statistic (5.47 KB, patch)
2025-04-17 15:57 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 39652: Add tests (2.82 KB, patch)
2025-04-19 09:27 UTC, David Nind
Details | Diff | Splinter Review
Bug 39652: store PseudonymizedTransaction before adding related entries (3.38 KB, patch)
2025-04-19 09:27 UTC, David Nind
Details | Diff | Splinter Review
Bug 39652: Rename new_from_statistic (5.51 KB, patch)
2025-04-19 09:27 UTC, David Nind
Details | Diff | Splinter Review
Bug 39652: Add tests (2.88 KB, patch)
2025-04-23 14:44 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 39652: store PseudonymizedTransaction before adding related entries (3.44 KB, patch)
2025-04-23 14:44 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 39652: Rename new_from_statistic (5.57 KB, patch)
2025-04-23 14:44 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 39652 (QA follow-up): Update misc/maintenance/pseudonymize_statistics.pl (980 bytes, patch)
2025-04-23 14:44 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 Pedro Amorim 2025-04-16 11:03:03 UTC
And the new PseudonymizedBorrowerAttribute entries to attach to the previous PseudonymizedTransaction
Comment 1 Pedro Amorim 2025-04-16 11:13:50 UTC
Created attachment 181001 [details] [review]
Bug 39652: Add tests

These tests prove the bug:
perl t/db_dependent/Koha/Pseudonymization.t
Comment 2 Pedro Amorim 2025-04-16 11:46:35 UTC
Created attachment 181002 [details] [review]
Bug 39652: store PseudonymizedTransaction before adding related entries

Test plan:
Run the tests before and after applying this patch:
perl t/db_dependent/Koha/Pseudonymization.t

They should fail before this patch and pass after applying patch.
Comment 3 Martin Renvoize (ashimema) 2025-04-17 12:26:45 UTC
The approach seems sound to me and works; I've already spoken to Pedro about the `new_` name and we agreed to perhaps rename to `create_` to clarify that in this case the method is actually storing data now do no subsequent 'store' is required.
Comment 4 Pedro Amorim 2025-04-17 15:56:26 UTC
Created attachment 181109 [details] [review]
Bug 39652: Rename new_from_statistic

This new method name better reflects the fact that it now creates - and stores - the PseudonymizedTransaction object
Comment 5 Pedro Amorim 2025-04-17 15:57:40 UTC
Created attachment 181110 [details] [review]
Bug 39652: Rename new_from_statistic

This new method name better reflects the fact that it now creates - and stores - the PseudonymizedTransaction object
Comment 6 David Nind 2025-04-19 09:27:50 UTC
Created attachment 181209 [details] [review]
Bug 39652: Add tests

These tests prove the bug:
perl t/db_dependent/Koha/Pseudonymization.t

Signed-off-by: David Nind <david@davidnind.com>
Comment 7 David Nind 2025-04-19 09:27:53 UTC
Created attachment 181210 [details] [review]
Bug 39652: store PseudonymizedTransaction before adding related entries

Test plan:
Run the tests before and after applying this patch:
perl t/db_dependent/Koha/Pseudonymization.t

They should fail before this patch and pass after applying patch.

Signed-off-by: David Nind <david@davidnind.com>
Comment 8 David Nind 2025-04-19 09:27:56 UTC
Created attachment 181211 [details] [review]
Bug 39652: Rename new_from_statistic

This new method name better reflects the fact that it now creates - and stores - the PseudonymizedTransaction object

Signed-off-by: David Nind <david@davidnind.com>
Comment 9 David Nind 2025-04-19 09:29:29 UTC
Testing notes (using KTD):
1. Apply the first patch.
2. The tests should fail: prove t/db_dependent/Koha/Pseudonymization.t
3. Apply the remaining patches.
3. The tests should now pass: prove t/db_dependent/Koha/Pseudonymization.t
Comment 10 Nick Clemens (kidclamp) 2025-04-23 14:44:14 UTC
Created attachment 181382 [details] [review]
Bug 39652: Add tests

These tests prove the bug:
perl t/db_dependent/Koha/Pseudonymization.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 11 Nick Clemens (kidclamp) 2025-04-23 14:44:16 UTC
Created attachment 181383 [details] [review]
Bug 39652: store PseudonymizedTransaction before adding related entries

Test plan:
Run the tests before and after applying this patch:
perl t/db_dependent/Koha/Pseudonymization.t

They should fail before this patch and pass after applying patch.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 12 Nick Clemens (kidclamp) 2025-04-23 14:44:18 UTC
Created attachment 181384 [details] [review]
Bug 39652: Rename new_from_statistic

This new method name better reflects the fact that it now creates - and stores - the PseudonymizedTransaction object

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 13 Nick Clemens (kidclamp) 2025-04-23 14:44:20 UTC
Created attachment 181385 [details] [review]
Bug 39652 (QA follow-up): Update misc/maintenance/pseudonymize_statistics.pl

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 14 Katrin Fischer 2025-04-24 17:48:27 UTC
Fixed before pushing: 

Processing additional checks

	* Commit title does not start with 'Bug XXXXX: ' - be2ae9c86ab
Comment 15 Katrin Fischer 2025-04-24 17:54:03 UTC
Pushed for 25.05!

Well done everyone, thank you!