Bug 29794 - delete_items.pl missing include
Summary: delete_items.pl missing include
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: Main
Hardware: All All
: P5 - low major
Assignee: Tomás Cohen Arazi (tcohen)
QA Contact: Testopia
URL:
Keywords:
Depends on: 23463
Blocks: 29788
  Show dependency treegraph
 
Reported: 2022-01-04 19:50 UTC by Tomás Cohen Arazi (tcohen)
Modified: 2022-12-12 21:24 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.05.00,21.11.02
Circulation function:


Attachments
Bug 29794: Add missing include in delete_items.pl (1.12 KB, patch)
2022-01-04 19:56 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 29794: (follow-up) Add license (1.44 KB, patch)
2022-01-04 19:56 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 29794: Add missing include in delete_items.pl (1.17 KB, patch)
2022-01-04 21:29 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 29794: (follow-up) Add license (1.49 KB, patch)
2022-01-04 21:29 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 29794: (follow-up) Add license (1.57 KB, patch)
2022-01-05 09:01 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi (tcohen) 2022-01-04 19:50:27 UTC
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"...
Comment 1 Tomás Cohen Arazi (tcohen) 2022-01-04 19:56:03 UTC
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
Comment 2 Tomás Cohen Arazi (tcohen) 2022-01-04 19:56:08 UTC
Created attachment 129012 [details] [review]
Bug 29794: (follow-up) Add license
Comment 3 Lucas Gass (lukeg) 2022-01-04 21:29:42 UTC
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>
Comment 4 Lucas Gass (lukeg) 2022-01-04 21:29:45 UTC
Created attachment 129015 [details] [review]
Bug 29794: (follow-up) Add license

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 5 Jonathan Druart 2022-01-05 08:58:45 UTC
Does nobody use this script?
Comment 6 Jonathan Druart 2022-01-05 09:01:27 UTC
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>
Comment 7 Fridolin Somers 2022-01-06 06:06:37 UTC
Bug 23463 replaced DelItemCheck() with Koha::Items->find() and $item->safe_delete
It should have impact the includes
Comment 8 Fridolin Somers 2022-01-10 07:05:17 UTC
Pushed to master for 22.05, thanks to everybody involved ﷐[U+1F984]﷑
Comment 9 Kyle M Hall (khall) 2022-01-14 13:37:11 UTC
Pushed to 21.11.x for 21.11.02
Comment 10 Andrew Fuerste-Henry 2022-01-21 16:38:12 UTC
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.