[Bug 29788] New: Make Koha::Item->safe_to_delete return a Koha::Result::Boolean object
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29788 Bug ID: 29788 Summary: Make Koha::Item->safe_to_delete return a Koha::Result::Boolean object Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: ASSIGNED Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: jonathan.druart+koha@gmail.com Reporter: jonathan.druart+koha@gmail.com QA Contact: testopia@bugs.koha-community.org Depends on: 29746 Same as bug 29765 for the existing Koha::Item->safe_to_delete Referenced Bugs: 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 watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29788 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29788 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |29789 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29789 [Bug 29789] Unused $error in cataloguing/additem.pl -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29788 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |29790 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29790 [Bug 29790] Deleting serial items fail without warning -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29788 Jonathan Druart <jonathan.druart+koha@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=29788 --- Comment #1 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 128993 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=128993&action=edit Bug 29788: Make Koha::Item->safe_to_delete use Koha::Result::Boolean This patch reuse the (awesome) Koha::Result::Boolean module to retrieve the return of Koha::Item->safe_to_delete. Test plan: Try to delete an item that has previously been checked out and confirm that you are still blocked. Try using the cronjobs, the item and biblio detail pages, as well as the batch delete item tool. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29788 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #128993|0 |1 is obsolete| | --- Comment #2 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 129010 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=129010&action=edit Bug 29788: Make Koha::Item->safe_to_delete use Koha::Result::Boolean This patch reuse the (awesome) Koha::Result::Boolean module to retrieve the return of Koha::Item->safe_to_delete. Test plan: Try to delete an item that has previously been checked out and confirm that you are still blocked. Try using the cronjobs, the item and biblio detail pages, as well as the batch delete item tool. 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=29788 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |29794 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29794 [Bug 29794] delete_items.pl missing include -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29788 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #3 from Tomás Cohen Arazi <tomascohen@gmail.com> --- I added 29794, which I found while testing this. The results are: - biblio/item views works as expected => SUCCESS - delete_items.pl => SUCCESS/FAIL: The check works, deletion is prevented, but the error message prints the Koha::Object::Message reference. It should be calling ->message in line 86.- batch delete. It also felt like we could do a join on multiple messages too? This last one is not a blocker of course. => FAIL: There's a problem with Koha/UI/Table/Builder/Items.pm line 111 calling 'ne' on the 'safe_to_delete' output (Koha::Result::Boolean). I tried a fast fix (checking the attribute was 'safe_to_delete' and evaluating in boolean context) but it turned out it broke blocking_errors.inc and I got out of fuel. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29788 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #129010|0 |1 is obsolete| | --- Comment #4 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 129013 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=129013&action=edit Bug 29788: Make Koha::Item->safe_to_delete use Koha::Result::Boolean This patch reuse the (awesome) Koha::Result::Boolean module to retrieve the return of Koha::Item->safe_to_delete. Test plan: Try to delete an item that has previously been checked out and confirm that you are still blocked. Try using the cronjobs, the item and biblio detail pages, as well as the batch delete item tool. 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=29788 --- Comment #5 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Tomás Cohen Arazi from comment #3)
=> SUCCESS/FAIL: The check works, deletion is prevented, but the error message prints the Koha::Object::Message reference. It should be calling ->message in line 86.- batch delete. It also felt like we could do a join on multiple messages too? This last one is not a blocker of course.
Fixed inline on the rebased patch (on top of the bug 29746 follow-up). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29788 --- Comment #6 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to Tomás Cohen Arazi from comment #3)
It also felt like we could do a join on multiple messages too? This last one is not a blocker of course.
I don't know. Either we should restrict "messages" to only 1 message (do we use more so far?), or we should have a new method in the module to ease the retrieval of a single message. I don't think we should restrict to 1 message only, even if we are not using more than 1 now, we could later. Maybe we could have something like: sub get_unique_message_str { my ( $self ) = @_; croak "There are more than one message" if @{$self->{_messages}} > 1; return @{$deleted->messages}[0]->messages } But that's for a separate bug report anyway. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29788 --- Comment #7 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to Tomás Cohen Arazi from comment #3)
It also felt like we could do a join on multiple messages too? This last one is not a blocker of course.
I don't know. Either we should restrict "messages" to only 1 message (do we use more so far?), or we should have a new method in the module to ease the retrieval of a single message. I don't think we should restrict to 1 message only, even if we are not using more than 1 now, we could later. Maybe we could have something like: sub get_unique_message_str { my ( $self ) = @_; croak "There are more than one message" if @{$self->{_messages}} > 1; return @{$self->messages}[0]->messages } But that's for a separate bug report anyway. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29788 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29788 --- Comment #8 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 129018 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=129018&action=edit Bug 29788: Fix batch delete item -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29788 --- Comment #9 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Lot of errors in my first patch, sorry about that! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29788 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #129018|0 |1 is obsolete| | --- Comment #10 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 129075 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=129075&action=edit Bug 29788: Fix batch delete item -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29788 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #129013|0 |1 is obsolete| | --- Comment #11 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 129076 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=129076&action=edit Bug 29788: Make Koha::Item->safe_to_delete use Koha::Result::Boolean This patch reuse the (awesome) Koha::Result::Boolean module to retrieve the return of Koha::Item->safe_to_delete. Test plan: Try to delete an item that has previously been checked out and confirm that you are still blocked. Try using the cronjobs, the item and biblio detail pages, as well as the batch delete item tool. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29788 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #129075|0 |1 is obsolete| | --- Comment #12 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 129077 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=129077&action=edit Bug 29788: Fix batch delete item -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29788 Tomás Cohen Arazi <tomascohen@gmail.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=29788 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #129076|0 |1 is obsolete| | --- Comment #13 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 129097 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=129097&action=edit Bug 29788: Make Koha::Item->safe_to_delete use Koha::Result::Boolean This patch reuse the (awesome) Koha::Result::Boolean module to retrieve the return of Koha::Item->safe_to_delete. Test plan: Try to delete an item that has previously been checked out and confirm that you are still blocked. Try using the cronjobs, the item and biblio detail pages, as well as the batch delete item tool. 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=29788 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #129077|0 |1 is obsolete| | --- Comment #14 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 129098 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=129098&action=edit Bug 29788: Fix batch delete item 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=29788 --- Comment #15 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Tested the different places, including Order.t tests. Things I found were fixed by Jonathan. QA script is happy, signing off :-D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29788 Bug 29788 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=29788 Kyle M Hall <kyle@bywatersolutions.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=29788 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #129097|0 |1 is obsolete| | Attachment #129098|0 |1 is obsolete| | --- Comment #16 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 129169 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=129169&action=edit Bug 29788: Make Koha::Item->safe_to_delete use Koha::Result::Boolean This patch reuse the (awesome) Koha::Result::Boolean module to retrieve the return of Koha::Item->safe_to_delete. Test plan: Try to delete an item that has previously been checked out and confirm that you are still blocked. Try using the cronjobs, the item and biblio detail pages, as well as the batch delete item tool. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <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=29788 --- Comment #17 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 129170 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=129170&action=edit Bug 29788: Fix batch delete item Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <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=29788 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=29788 --- Comment #18 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=29788 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m --- Comment #19 from Fridolin Somers <fridolin.somers@biblibre.com> --- Ah Test suite fails on t/db_dependent/Reserves.t : https://jenkins.koha-community.org/view/master/job/Koha_Master_D10/505/testR... I see it needs to be fixed like t/db_dependent/Circulation/IsItemIssued.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29788 --- Comment #20 from Fridolin Somers <fridolin.somers@biblibre.com> --- Created attachment 129326 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=129326&action=edit Bug 29788: Fix t/db_dependent/Reserves.t Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29788 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com 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=29788 Bug 29788 depends on bug 29794, which changed state. Bug 29794 Summary: delete_items.pl missing include https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29794 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |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=29788 Bug 29788 depends on bug 29789, which changed state. Bug 29789 Summary: Unused $error in cataloguing/additem.pl https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29789 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldstable |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=29788 --- Comment #21 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 132052 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=132052&action=edit Bug 29788: (follow-up) Make Koha::Item->safe_to_delete use Koha::Result::Boolean There were several wrong things in the previous patch! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29788 Jonathan Druart <jonathan.druart+koha@gmail.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=29788 --- Comment #22 from Fridolin Somers <fridolin.somers@biblibre.com> ---
Bug 29788: (follow-up) Make Koha::Item->safe_to_delete use Koha::Result::Boolean 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=29788 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=29788 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |30644 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30644 [Bug 30644] Cannot delete items -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29788 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |32656 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32656 [Bug 32656] Script delete_records_via_leader.pl no longer deletes items -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org