[Bug 30007] New: Make ->anonymize methods throw an exception if AnonymousPatron is not set
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30007 Bug ID: 30007 Summary: Make ->anonymize methods throw an exception if AnonymousPatron is not set Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com QA Contact: testopia@bugs.koha-community.org If the system preference AnonymousPatron is not set, the following methods should throw an exception: - Koha::Old::Hold(s)->anonymize - Koha::Old::Checkout(s)->anonymize -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30007 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | Depends on| |29843 CC| |jonathan.druart+koha@gmail. | |com, | |kyle@bywatersolutions.com, | |martin.renvoize@ptfs-europe | |.com Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29843 [Bug 29843] Add ->anonymize and ->filter_by_anonymizable to Koha::Old::Checkouts -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30007 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30007 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |29857 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29857 [Bug 29857] We must stringify our exceptions correctly -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30007 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |30023 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30023 [Bug 30023] Add Koha::Old::Checkout->anonymize -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30007 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30007 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 130163 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=130163&action=edit Bug 30007: Add Koha::Exceptions::SysPref Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30007 --- Comment #2 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 130164 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=130164&action=edit Bug 30007: Regression tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30007 --- Comment #3 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 130165 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=130165&action=edit Bug 30007: Make ->anonymize methods throw an exception if AnonymousPatron is not set This patch makes the ->anonymize methods throw a Koha::Exceptions::SysPref::NotSet exception when trying to anonymize holds and checkouts without AnonymousPatron properly set. To test: 1. Apply the regression tests patch 2. Run: $ kshell k$ prove t/db_dependent/Koha/Old/Checkouts.t \ t/db_dependent/Koha/Old/Holds.t \ t/db_dependent/Koha/Old/Hold.t => FAIL: Tests fail, no exception thrown 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! 5. Sign off :-D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30007 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30007 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #130164|0 |1 is obsolete| | --- Comment #4 from David Nind <david@davidnind.com> --- Created attachment 130175 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=130175&action=edit Bug 30007: Regression tests Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30007 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #130163|0 |1 is obsolete| | --- Comment #5 from David Nind <david@davidnind.com> --- Created attachment 130176 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=130176&action=edit Bug 30007: Add Koha::Exceptions::SysPref Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30007 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #130165|0 |1 is obsolete| | --- Comment #6 from David Nind <david@davidnind.com> --- Created attachment 130177 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=130177&action=edit Bug 30007: Make ->anonymize methods throw an exception if AnonymousPatron is not set This patch makes the ->anonymize methods throw a Koha::Exceptions::SysPref::NotSet exception when trying to anonymize holds and checkouts without AnonymousPatron properly set. To test: 1. Apply the regression tests patch 2. Run: $ kshell k$ prove t/db_dependent/Koha/Old/Checkouts.t \ t/db_dependent/Koha/Old/Holds.t \ t/db_dependent/Koha/Old/Hold.t => FAIL: Tests fail, no exception thrown 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! 5. Sign off :-D Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30007 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #130175|0 |1 is obsolete| | --- Comment #7 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 130272 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=130272&action=edit Bug 30007: Regression tests Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> https://bugs.koha-community.org/show_bug.cgi?id=3007 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30007 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #130176|0 |1 is obsolete| | --- Comment #8 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 130273 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=130273&action=edit Bug 30007: Add Koha::Exceptions::SysPref Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> https://bugs.koha-community.org/show_bug.cgi?id=3007 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30007 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #130177|0 |1 is obsolete| | --- Comment #9 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 130274 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=130274&action=edit Bug 30007: Make ->anonymize methods throw an exception if AnonymousPatron is not set This patch makes the ->anonymize methods throw a Koha::Exceptions::SysPref::NotSet exception when trying to anonymize holds and checkouts without AnonymousPatron properly set. To test: 1. Apply the regression tests patch 2. Run: $ kshell k$ prove t/db_dependent/Koha/Old/Checkouts.t \ t/db_dependent/Koha/Old/Holds.t \ t/db_dependent/Koha/Old/Hold.t => FAIL: Tests fail, no exception thrown 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! 5. Sign off :-D Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> https://bugs.koha-community.org/show_bug.cgi?id=3007 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30007 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA --- Comment #10 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Solid improvement, Passing QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30007 Bug 30007 depends on bug 29843, which changed state. Bug 29843 Summary: Add ->anonymize and ->filter_by_anonymizable to Koha::Old::Checkouts https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29843 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30007 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m --- Comment #11 from Fridolin Somers <fridolin.somers@biblibre.com> --- Waiting for Bug 29857 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30007 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |dependency -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30007 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|dependency | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30007 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |22.05.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30007 --- Comment #12 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to master for 22.05, thanks to everybody involved 🦄 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30007 --- Comment #13 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 131239 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=131239&action=edit Bug 30007: (follow-up) Adjust Koha::Patrons->search_patrons_to_anonymise tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30007 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |additional_work_needed --- Comment #14 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Frido, I posted a follow-up for Koha/Patrons.t tests failures. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30007 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |release-notes-needed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30007 --- Comment #15 from Fridolin Somers <fridolin.somers@biblibre.com> --- Patch "(follow-up) Adjust Koha::Patrons->search_patrons_to_anonymise tests" pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30007 --- Comment #16 from Fridolin Somers <fridolin.somers@biblibre.com> --- Ohhh but this changes the actual behavior. Without this patch running anonymise with AnonymousPatron undefined (0 or empry string) is allowed : borrowernumber is set to null This is usefull because AnonymousPatron default value is 0. We agree on new behavior and create a unit test for this case. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30007 --- Comment #17 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 131298 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=131298&action=edit Bug 30007: (follow-up) Adapt tests This patch adapts tests to acknowledge ->cancel and ->fill methods won't yield 'undef' borrowernumber when anonymization takes place, and even further, and exception will be thrown and cancellation/fulfillment will be rejected. To test: 1. Apply this patch 2. Run: $ kshell k$ prove t/db_dependent/Koha/Hold.t => SUCCESS: Tests pass! 3. Sign off :-D Bonus: this problem was hidding bad tests caused by 29857, fixed on this one as well. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30007 --- Comment #18 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Fridolin Somers from comment #16)
Ohhh but this changes the actual behavior. Without this patch running anonymise with AnonymousPatron undefined (0 or empry string) is allowed : borrowernumber is set to null This is usefull because AnonymousPatron default value is 0.
We agree on new behavior and create a unit test for this case.
Sorry for the delay. Latest patch adapts the tests. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30007 --- Comment #19 from Fridolin Somers <fridolin.somers@biblibre.com> --- Patch "Bug 30007: (follow-up) Adapt tests" pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30007 --- Comment #20 from Fridolin Somers <fridolin.somers@biblibre.com> --- (In reply to Fridolin Somers from comment #16)
Ohhh but this changes the actual behavior. Without this patch running anonymise with AnonymousPatron undefined (0 or empry string) is allowed : borrowernumber is set to null This is usefull because AnonymousPatron default value is 0.
But do we all agree with this new behavior. How manage existing databases upgrade having AnonymousPatron not configured but still use batch_anonyise.pl (we have that a lot at Biblibre) ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30007 --- Comment #21 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Fridolin Somers from comment #20)
(In reply to Fridolin Somers from comment #16)
Ohhh but this changes the actual behavior. Without this patch running anonymise with AnonymousPatron undefined (0 or empry string) is allowed : borrowernumber is set to null This is usefull because AnonymousPatron default value is 0.
But do we all agree with this new behavior.
How manage existing databases upgrade having AnonymousPatron not configured but still use batch_anonyise.pl (we have that a lot at Biblibre) ?
For the record, check-in dies if AnonymousPatron is not set, since bug 9942. I see two options: - Add an anonymous patron on a DBrev. - Disable OPACPrivacy if AnonymousPatron is incorrectly set. This is already highlighted in about.pl as far as I can tell (see bug 24327). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30007 Bug 30007 depends on bug 29857, which changed state. Bug 29857 Summary: We must stringify our exceptions correctly https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29857 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30007 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Pushed to master |RESOLVED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30007 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|additional_work_needed | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30007 --- Comment #22 from Fridolin Somers <fridolin.somers@biblibre.com> --- We should remove this help text : https://git.koha-community.org/Koha-community/Koha/src/branch/22.11.x/misc/c... "Note: If the system preference 'AnonymousPatron' is not defined, NULL will be used." -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30007 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|release-notes-needed | -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org