[Bug 29765] New: Make Koha::Patron->safe_to_delete return a Koha::Result::Boolean object
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29765 Bug ID: 29765 Summary: Make Koha::Patron->safe_to_delete return a Koha::Result::Boolean object Change sponsored?: --- Product: Koha Version: master 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 With the purpose of highlighting the value of the Koha::Result::Boolean class, this bug will migrate the current implementation with string return values to one using Koha::Result::Boolean instead -- 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=29765 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |29741, 29746 Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | Status|NEW |ASSIGNED Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29741 [Bug 29741] Add Koha::Patron->safe_to_delete https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29746 [Bug 29746] Add a handy Koha::Result::Boolean class -- 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=29765 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 128887 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=128887&action=edit Bug 29765: Make Koha::Patron->safe_to_delete use Koha::Result::Boolean This patch makes the safe_to_delete method in Koha::Patron return this new object type instead of a plain string. This way we have a consistent way to deal with 'can_*'-like methods return values when feedback is needed. To test: 1. Apply this patch 2. Run: $ kshell k$ prove t/db_dependent/Koha/Patron.t => SUCCESS: The adjusted tests pass. Tests cover the boolean context eval and also the carried messages, that include the same string code that was returned originally. 3. 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=29765 --- Comment #2 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 128888 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=128888&action=edit Bug 29765: Adjust DELETE /patrons/:patron_id controller This patch adjusts the only current place using the Koha::Patron->safe_to_delete method to the new return value. There should be no behavior change To test: 1. Apply the previous patches 2. Run: $ kshell k$ prove t/db_dependent/api/v1/patrons.t => FAIL: Tests fail, because of the change, the controller is broken 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! No test tweak required, no behavior change 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=29765 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- 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=29765 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #128888|0 |1 is obsolete| | --- Comment #3 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 128914 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=128914&action=edit Bug 29765: Adjust DELETE /patrons/:patron_id controller This patch adjusts the only current place using the Koha::Patron->safe_to_delete method to the new return value. There should be no behavior change To test: 1. Apply the previous patches 2. Run: $ kshell k$ prove t/db_dependent/api/v1/patrons.t => FAIL: Tests fail, because of the change, the controller is broken 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! No test tweak required, no behavior change 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=29765 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |29772 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29772 [Bug 29772] Make DELETE /patrons return error codes in error conditions -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29765 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=29765 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #128887|0 |1 is obsolete| | --- Comment #4 from David Nind <david@davidnind.com> --- Created attachment 128928 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=128928&action=edit Bug 29765: Make Koha::Patron->safe_to_delete use Koha::Result::Boolean This patch makes the safe_to_delete method in Koha::Patron return this new object type instead of a plain string. This way we have a consistent way to deal with 'can_*'-like methods return values when feedback is needed. To test: 1. Apply this patch 2. Run: $ kshell k$ prove t/db_dependent/Koha/Patron.t => SUCCESS: The adjusted tests pass. Tests cover the boolean context eval and also the carried messages, that include the same string code that was returned originally. 3. 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=29765 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #128914|0 |1 is obsolete| | --- Comment #5 from David Nind <david@davidnind.com> --- Created attachment 128929 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=128929&action=edit Bug 29765: Adjust DELETE /patrons/:patron_id controller This patch adjusts the only current place using the Koha::Patron->safe_to_delete method to the new return value. There should be no behavior change To test: 1. Apply the previous patches 2. Run: $ kshell k$ prove t/db_dependent/api/v1/patrons.t => FAIL: Tests fail, because of the change, the controller is broken 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! No test tweak required, no behavior change 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=29765 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com --- Comment #6 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- If we are using Koha::Result::Boolean for Koha::Patron->safe_to_delete we certainly need to implement it for Koha::Item->safe_to_delete as well (same time, same push). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29765 --- Comment #7 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Jonathan Druart from comment #6)
If we are using Koha::Result::Boolean for Koha::Patron->safe_to_delete we certainly need to implement it for Koha::Item->safe_to_delete as well (same time, same push).
Sure, if we have consensus on things, I can do it. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29765 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=29788 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29765 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29765 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #128928|0 |1 is obsolete| | --- Comment #8 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 128999 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=128999&action=edit Bug 29765: Make Koha::Patron->safe_to_delete use Koha::Result::Boolean This patch makes the safe_to_delete method in Koha::Patron return this new object type instead of a plain string. This way we have a consistent way to deal with 'can_*'-like methods return values when feedback is needed. To test: 1. Apply this patch 2. Run: $ kshell k$ prove t/db_dependent/Koha/Patron.t => SUCCESS: The adjusted tests pass. Tests cover the boolean context eval and also the carried messages, that include the same string code that was returned originally. 3. Sign off :-D Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29765 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #128929|0 |1 is obsolete| | --- Comment #9 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 129000 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=129000&action=edit Bug 29765: Adjust DELETE /patrons/:patron_id controller This patch adjusts the only current place using the Koha::Patron->safe_to_delete method to the new return value. There should be no behavior change To test: 1. Apply the previous patches 2. Run: $ kshell k$ prove t/db_dependent/api/v1/patrons.t => FAIL: Tests fail, because of the change, the controller is broken 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! No test tweak required, no behavior change 5. Sign off :-D Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29765 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |22.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29765 --- Comment #10 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=29765 Bug 29765 depends on bug 29746, which changed state. Bug 29746 Summary: Add a handy Koha::Result::Boolean class https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29746 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=29765 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Pushed to master |RESOLVED CC| |kyle@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29765 Bug 29765 depends on bug 29741, which changed state. Bug 29741 Summary: Add Koha::Patron->safe_to_delete https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29741 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org