Bug 29843 - Add ->anonymize and ->filter_by_anonymizable to Koha::Old::Checkouts
Summary: Add ->anonymize and ->filter_by_anonymizable to Koha::Old::Checkouts
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Tomás Cohen Arazi
QA Contact: Testopia
URL:
Keywords:
Depends on: 29525 29526
Blocks:
  Show dependency treegraph
 
Reported: 2022-01-10 14:21 UTC by Tomás Cohen Arazi
Modified: 2022-01-14 14:57 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 29843: Unit tests (6.54 KB, patch)
2022-01-10 14:33 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 29843: Add ->anonymize and ->filter_by_anonymizable to Koha::Old::Checkouts (2.55 KB, patch)
2022-01-10 14:33 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 29843: Use in batch_anonymise.pl (1.54 KB, patch)
2022-01-10 14:33 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 29843: Use in opac/opac-privacy.pl (1.17 KB, patch)
2022-01-10 14:51 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 29843: Unit tests (6.60 KB, patch)
2022-01-10 15:19 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 29843: Add ->anonymize and ->filter_by_anonymizable to Koha::Old::Checkouts (2.55 KB, patch)
2022-01-10 15:19 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 29843: Use in batch_anonymise.pl (1.54 KB, patch)
2022-01-10 15:19 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 29843: Use in opac/opac-privacy.pl (1.17 KB, patch)
2022-01-10 15:20 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 29843: Use in tools/cleanborrowers.pl (1.42 KB, patch)
2022-01-10 15:20 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 29843: Unit tests (6.60 KB, patch)
2022-01-13 19:21 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 29843: Add ->anonymize and ->filter_by_anonymizable to Koha::Old::Checkouts (2.55 KB, patch)
2022-01-13 19:21 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 29843: Use in batch_anonymise.pl (1.54 KB, patch)
2022-01-13 19:22 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 29843: Use in opac/opac-privacy.pl (4.01 KB, patch)
2022-01-13 19:22 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 29843: Use in tools/cleanborrowers.pl (1.42 KB, patch)
2022-01-13 19:22 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 29843: Unit tests (6.60 KB, patch)
2022-01-13 19:51 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 29843: Add ->anonymize and ->filter_by_anonymizable to Koha::Old::Checkouts (2.55 KB, patch)
2022-01-13 19:52 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 29843: Use in batch_anonymise.pl (1.54 KB, patch)
2022-01-13 19:52 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 29843: Use in opac/opac-privacy.pl (1.73 KB, patch)
2022-01-13 19:52 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 29843: Use in tools/cleanborrowers.pl (1.42 KB, patch)
2022-01-13 19:52 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 29843: Unit tests (6.60 KB, patch)
2022-01-14 13:01 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 29843: Add ->anonymize and ->filter_by_anonymizable to Koha::Old::Checkouts (2.55 KB, patch)
2022-01-14 13:01 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 29843: Use in batch_anonymise.pl (1.58 KB, patch)
2022-01-14 13:01 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 29843: Use in opac/opac-privacy.pl (1.73 KB, patch)
2022-01-14 13:01 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 29843: Use in tools/cleanborrowers.pl (1.49 KB, patch)
2022-01-14 13:01 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 29843: Unit tests (6.66 KB, patch)
2022-01-14 14:57 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 29843: Add ->anonymize and ->filter_by_anonymizable to Koha::Old::Checkouts (2.61 KB, patch)
2022-01-14 14:57 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 29843: Use in batch_anonymise.pl (1.65 KB, patch)
2022-01-14 14:57 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 29843: Use in opac/opac-privacy.pl (1.79 KB, patch)
2022-01-14 14:57 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 29843: Use in tools/cleanborrowers.pl (1.55 KB, patch)
2022-01-14 14:57 UTC, Andrew Fuerste-Henry
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 2022-01-10 14:21:11 UTC
This bug is the checkouts counterpart for bug 29525 and bug 29780.
The pattern implemented there seems cleaner than the current implementation, so giving it a try so we clean things even further.
Comment 1 Tomás Cohen Arazi 2022-01-10 14:33:41 UTC Comment hidden (obsolete)
Comment 2 Tomás Cohen Arazi 2022-01-10 14:33:45 UTC Comment hidden (obsolete)
Comment 3 Tomás Cohen Arazi 2022-01-10 14:33:50 UTC Comment hidden (obsolete)
Comment 4 Tomás Cohen Arazi 2022-01-10 14:51:18 UTC Comment hidden (obsolete)
Comment 5 Tomás Cohen Arazi 2022-01-10 15:19:51 UTC Comment hidden (obsolete)
Comment 6 Tomás Cohen Arazi 2022-01-10 15:19:55 UTC Comment hidden (obsolete)
Comment 7 Tomás Cohen Arazi 2022-01-10 15:19:59 UTC Comment hidden (obsolete)
Comment 8 Tomás Cohen Arazi 2022-01-10 15:20:04 UTC Comment hidden (obsolete)
Comment 9 Tomás Cohen Arazi 2022-01-10 15:20:11 UTC Comment hidden (obsolete)
Comment 10 Tomás Cohen Arazi 2022-01-13 19:21:51 UTC Comment hidden (obsolete)
Comment 11 Tomás Cohen Arazi 2022-01-13 19:21:57 UTC Comment hidden (obsolete)
Comment 12 Tomás Cohen Arazi 2022-01-13 19:22:05 UTC Comment hidden (obsolete)
Comment 13 Tomás Cohen Arazi 2022-01-13 19:22:12 UTC Comment hidden (obsolete)
Comment 14 Tomás Cohen Arazi 2022-01-13 19:22:18 UTC Comment hidden (obsolete)
Comment 15 Tomás Cohen Arazi 2022-01-13 19:51:58 UTC Comment hidden (obsolete)
Comment 16 Tomás Cohen Arazi 2022-01-13 19:52:04 UTC Comment hidden (obsolete)
Comment 17 Tomás Cohen Arazi 2022-01-13 19:52:13 UTC Comment hidden (obsolete)
Comment 18 Tomás Cohen Arazi 2022-01-13 19:52:21 UTC Comment hidden (obsolete)
Comment 19 Tomás Cohen Arazi 2022-01-13 19:52:30 UTC Comment hidden (obsolete)
Comment 20 Tomás Cohen Arazi 2022-01-14 13:01:39 UTC
Created attachment 129475 [details] [review]
Bug 29843: Unit tests

This patch adds unit tests for the introduced methods.
Comment 21 Tomás Cohen Arazi 2022-01-14 13:01:43 UTC
Created attachment 129476 [details] [review]
Bug 29843: Add ->anonymize and ->filter_by_anonymizable to Koha::Old::Checkouts

This patch implements high-level methods for:

* Filtering a Koha::Old::Checkouts resultset so only anonymizable rows
  are left
* Anonymizing the rows in a resultset

To test:
1. Apply this patches
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Old/Checkouts.t
=> SUCCESS: Tests pass!
3. Sign off :-D
Comment 22 Tomás Cohen Arazi 2022-01-14 13:01:49 UTC
Created attachment 129477 [details] [review]
Bug 29843: Use in batch_anonymise.pl

This patch makes the batch_anonymise.pl cronjob script use the newly
introduced methods instead of the old ones.

To test:
1. Try the tool
=> SUCCESS: No behavior change
2. Sign off :-D
Comment 23 Tomás Cohen Arazi 2022-01-14 13:01:54 UTC
Created attachment 129478 [details] [review]
Bug 29843: Use in opac/opac-privacy.pl

This patch makes the opac/opac-privacy.pl OPAC page use the new
anonymize method.

To test:
1. Have some checked-in materiales
2. Have OPACPrivacy enabled
3. Notice your checkouts history contains what you expect
4. Go to 'your privacy'
5. Click on 'Delete checkout history'
=> SUCCESS: It works, no crash.
6. Sign off :-D
Comment 24 Tomás Cohen Arazi 2022-01-14 13:01:58 UTC
Created attachment 129479 [details] [review]
Bug 29843: Use in tools/cleanborrowers.pl

This patch makes tools/cleanborrowers.pl use the new methods.
Comment 25 Andrew Fuerste-Henry 2022-01-14 14:57:11 UTC
Created attachment 129492 [details] [review]
Bug 29843: Unit tests

This patch adds unit tests for the introduced methods.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 26 Andrew Fuerste-Henry 2022-01-14 14:57:16 UTC
Created attachment 129493 [details] [review]
Bug 29843: Add ->anonymize and ->filter_by_anonymizable to Koha::Old::Checkouts

This patch implements high-level methods for:

* Filtering a Koha::Old::Checkouts resultset so only anonymizable rows
  are left
* Anonymizing the rows in a resultset

To test:
1. Apply this patches
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Old/Checkouts.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 27 Andrew Fuerste-Henry 2022-01-14 14:57:20 UTC
Created attachment 129494 [details] [review]
Bug 29843: Use in batch_anonymise.pl

This patch makes the batch_anonymise.pl cronjob script use the newly
introduced methods instead of the old ones.

To test:
1. Try the tool
=> SUCCESS: No behavior change
2. Sign off :-D

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 28 Andrew Fuerste-Henry 2022-01-14 14:57:24 UTC
Created attachment 129495 [details] [review]
Bug 29843: Use in opac/opac-privacy.pl

This patch makes the opac/opac-privacy.pl OPAC page use the new
anonymize method.

To test:
1. Have some checked-in materiales
2. Have OPACPrivacy enabled
3. Notice your checkouts history contains what you expect
4. Go to 'your privacy'
5. Click on 'Delete checkout history'
=> SUCCESS: It works, no crash.
6. Sign off :-D

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 29 Andrew Fuerste-Henry 2022-01-14 14:57:28 UTC
Created attachment 129496 [details] [review]
Bug 29843: Use in tools/cleanborrowers.pl

This patch makes tools/cleanborrowers.pl use the new methods.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>