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>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit
02a404ef42683b3c19bb937cdd3bd7449c5fbd3a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit
92e69e25eefd6a603d6bb9f094a27a10c749154a)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>