Bug 30023

Summary: Add Koha::Old::Checkout->anonymize
Product: Koha Reporter: Tomás Cohen Arazi <tomascohen>
Component: Architecture, internals, and plumbingAssignee: Tomás Cohen Arazi <tomascohen>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: kyle, martin.renvoize
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.05.00
Bug Depends on: 30007    
Bug Blocks:    
Attachments: Bug 30023: Add Koha::Old::Checkout->anonymize
Bug 30023: Make MarkIssueReturned use ->anonymize
Bug 30023: Add Koha::Old::Checkout->anonymize
Bug 30023: Make MarkIssueReturned use ->anonymize
Bug 30023: Add Koha::Old::Checkout->anonymize
Bug 30023: Make MarkIssueReturned use ->anonymize

Description Tomás Cohen Arazi 2022-02-04 11:39:42 UTC
Not sure why, but I forgot to add this method earlier on the bug tree. Needed for consistency and completion of the refactoring.
Comment 1 Tomás Cohen Arazi 2022-02-04 14:09:43 UTC
Created attachment 130161 [details] [review]
Bug 30023: Add Koha::Old::Checkout->anonymize

This patch adds the mentioned method. It replicates the Koha::Old::Hold
behavior, including the exception thrown on bad configuration.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Old/Checkout.t
=> SUCCESS: Test pass
3. Sign off :-D
Comment 2 Tomás Cohen Arazi 2022-02-04 14:09:49 UTC
Created attachment 130162 [details] [review]
Bug 30023: Make MarkIssueReturned use ->anonymize

Koha::Old::Checkout->anonymize takes care of checking the syspref and
raises an exception if not set. So no we can now leverage on it, instead
of checking manually and then tweaking the checkout object manually as
well.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Circulation/MarkIssueReturned.t
=> SUCCESS: Tests pass!
3. Sign off :-D
Comment 3 David Nind 2022-02-04 19:43:22 UTC
Created attachment 130178 [details] [review]
Bug 30023: Add Koha::Old::Checkout->anonymize

This patch adds the mentioned method. It replicates the Koha::Old::Hold
behavior, including the exception thrown on bad configuration.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Old/Checkout.t
=> SUCCESS: Test pass
3. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>
Comment 4 David Nind 2022-02-04 19:43:26 UTC
Created attachment 130179 [details] [review]
Bug 30023: Make MarkIssueReturned use ->anonymize

Koha::Old::Checkout->anonymize takes care of checking the syspref and
raises an exception if not set. So no we can now leverage on it, instead
of checking manually and then tweaking the checkout object manually as
well.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Circulation/MarkIssueReturned.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>
Comment 5 Martin Renvoize 2022-02-08 10:00:51 UTC
Created attachment 130277 [details] [review]
Bug 30023: Add Koha::Old::Checkout->anonymize

This patch adds the mentioned method. It replicates the Koha::Old::Hold
behavior, including the exception thrown on bad configuration.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Old/Checkout.t
=> SUCCESS: Test pass
3. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 6 Martin Renvoize 2022-02-08 10:00:54 UTC
Created attachment 130278 [details] [review]
Bug 30023: Make MarkIssueReturned use ->anonymize

Koha::Old::Checkout->anonymize takes care of checking the syspref and
raises an exception if not set. So no we can now leverage on it, instead
of checking manually and then tweaking the checkout object manually as
well.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Circulation/MarkIssueReturned.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 7 Martin Renvoize 2022-02-08 10:02:09 UTC
All works as designed and clarifies the code.  Tested, and QA scripts happy.

Passing QA
Comment 8 Fridolin Somers 2022-03-02 08:49:06 UTC
Pushed to master for 22.05, thanks to everybody involved 🦄