To reproduce: 1. Choose an item that is checked out and copy its barcode 2. Run: $ kshell k$ perl misc/cronjobs/delete_items.pl --verbose \ --where "barcode='39999000010831'" => FAIL: It explodes with: Can't locate object method "find" via package "Koha::Items"...
Created attachment 129011 [details] [review] Bug 29794: Add missing include in delete_items.pl This patch adds a missing include so the script is no longer broken. To test: 1. Choose an item that is checked out and copy its barcode 2. Run: $ kshell k$ perl misc/cronjobs/delete_items.pl --verbose \ --where "barcode='39999000010831'" => FAIL: It explodes with: Can't locate object method "find" via package "Koha::Items"... 3. Apply this patch 4. Repeat 2 => SUCCESS: You get: Where statement: where barcode='39999000010831' Item '549' not deleted: book_on_loan 5. Sign off :-D
Created attachment 129012 [details] [review] Bug 29794: (follow-up) Add license
Created attachment 129014 [details] [review] Bug 29794: Add missing include in delete_items.pl This patch adds a missing include so the script is no longer broken. To test: 1. Choose an item that is checked out and copy its barcode 2. Run: $ kshell k$ perl misc/cronjobs/delete_items.pl --verbose \ --where "barcode='39999000010831'" => FAIL: It explodes with: Can't locate object method "find" via package "Koha::Items"... 3. Apply this patch 4. Repeat 2 => SUCCESS: You get: Where statement: where barcode='39999000010831' Item '549' not deleted: book_on_loan 5. Sign off :-D Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Created attachment 129015 [details] [review] Bug 29794: (follow-up) Add license Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Does nobody use this script?
Created attachment 129017 [details] [review] Bug 29794: (follow-up) Add license Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 23463 replaced DelItemCheck() with Koha::Items->find() and $item->safe_delete It should have impact the includes
Pushed to master for 22.05, thanks to everybody involved [U+1F984]
Pushed to 21.11.x for 21.11.02
I can't recreate this issue on 21.05.x. Following the test plan, I get the correct message of "Item '1' not deleted: book_on_loan" without the patch applied. Not backporting, please request if needed.