Summary: | Spurious errors when running delete_records_via_leader.pl | ||
---|---|---|---|
Product: | Koha | Reporter: | Nick Clemens <nick> |
Component: | Command-line Utilities | Assignee: | Nick Clemens <nick> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | andrewfh, fridolin.somers, jonathan.druart, martin.renvoize, robin, victor |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
21.05.00,20.11.06,20.05.12
|
|
Bug Depends on: | 23463 | ||
Bug Blocks: | |||
Attachments: |
Bug 27819: Spurious item deletion errors from delete_records_via_leader.pl
Bug 27819: Fix Object POD Bug 27819: Spurious item deletion errors from delete_records_via_leader.pl Bug 27819: Fix Object POD Bug 27819: Spurious item deletion errors from delete_records_via_leader.pl Bug 27819: Fix Object POD |
Description
Nick Clemens
2021-02-27 17:24:50 UTC
Created attachment 117406 [details] [review] Bug 27819: Spurious item deletion errors from delete_records_via_leader.pl The job reports errors when deleting items. The issue seems to be that Koha::Object->delete claims in the POD to return -1, 0, or 1 as a result, but it in fact returns the Object itself on a successful deletion The errors are reported as: ERROR DELETING ITEM 501740: Koha::Item=HASH(0x55ce407a1a78) To recreate: 1 - Find or create a record with some items 2 - Ensure those items can be deleted (not on loan, etc.) 3 - Edit the record leader and set position 5 to 'd' 4 - perl misc/cronjobs/delete_records_via_leader.pl -i -v --confirm 5 - Deletion succeeds, but reports failure on items 6 - Apply patch 7 - Find or create a new record as above, but this time add an additional item and check it out to a patron 8 - perl misc/cronjobs/delete_records_via_leader.pl -i -v 9 - Test mode should report 1 item to be deleted, one with error 10 - perl misc/cronjobs/delete_records_via_leader.pl -i -v --confirm 11 - One item should be deleted, one item not, record not deleted 12 - check the item in 13 - perl misc/cronjobs/delete_records_via_leader.pl -i -v --confirm 14 - Successful deletion with no error reported Created attachment 117407 [details] [review] Bug 27819: Fix Object POD Created attachment 119631 [details] [review] Bug 27819: Spurious item deletion errors from delete_records_via_leader.pl The job reports errors when deleting items. The issue seems to be that Koha::Object->delete claims in the POD to return -1, 0, or 1 as a result, but it in fact returns the Object itself on a successful deletion The errors are reported as: ERROR DELETING ITEM 501740: Koha::Item=HASH(0x55ce407a1a78) To recreate: 1 - Find or create a record with some items 2 - Ensure those items can be deleted (not on loan, etc.) 3 - Edit the record leader and set position 5 to 'd' 4 - perl misc/cronjobs/delete_records_via_leader.pl -i -v --confirm 5 - Deletion succeeds, but reports failure on items 6 - Apply patch 7 - Find or create a new record as above, but this time add an additional item and check it out to a patron 8 - perl misc/cronjobs/delete_records_via_leader.pl -i -v 9 - Test mode should report 1 item to be deleted, one with error 10 - perl misc/cronjobs/delete_records_via_leader.pl -i -v --confirm 11 - One item should be deleted, one item not, record not deleted 12 - check the item in 13 - perl misc/cronjobs/delete_records_via_leader.pl -i -v --confirm 14 - Successful deletion with no error reported Signed-off-by: Owen Leonard <oleonard@myacpl.org> Created attachment 119632 [details] [review] Bug 27819: Fix Object POD Signed-off-by: Owen Leonard <oleonard@myacpl.org> Created attachment 120232 [details] [review] Bug 27819: Spurious item deletion errors from delete_records_via_leader.pl The job reports errors when deleting items. The issue seems to be that Koha::Object->delete claims in the POD to return -1, 0, or 1 as a result, but it in fact returns the Object itself on a successful deletion The errors are reported as: ERROR DELETING ITEM 501740: Koha::Item=HASH(0x55ce407a1a78) To recreate: 1 - Find or create a record with some items 2 - Ensure those items can be deleted (not on loan, etc.) 3 - Edit the record leader and set position 5 to 'd' 4 - perl misc/cronjobs/delete_records_via_leader.pl -i -v --confirm 5 - Deletion succeeds, but reports failure on items 6 - Apply patch 7 - Find or create a new record as above, but this time add an additional item and check it out to a patron 8 - perl misc/cronjobs/delete_records_via_leader.pl -i -v 9 - Test mode should report 1 item to be deleted, one with error 10 - perl misc/cronjobs/delete_records_via_leader.pl -i -v --confirm 11 - One item should be deleted, one item not, record not deleted 12 - check the item in 13 - perl misc/cronjobs/delete_records_via_leader.pl -i -v --confirm 14 - Successful deletion with no error reported Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 120233 [details] [review] Bug 27819: Fix Object POD Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> All works as expected.. always nice to quieten things down bit. Passing QA (In reply to Martin Renvoize from comment #6) > Created attachment 120233 [details] [review] [review] > Bug 27819: Fix Object POD > > Signed-off-by: Owen Leonard <oleonard@myacpl.org> > Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> For the record, this is tested correctly in t/db_dependent/Koha/Objects.t, subtest 'Koha::Object->delete' Pushed to master for 21.05, thanks to everybody involved! Pushed to 20.11.x for 20.11.06 Pushed to 20.05.x for 20.05.12 Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed. |