Bug 24324 - delete_records_via_leader.pl cron error with item deletion
Summary: delete_records_via_leader.pl cron error with item deletion
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Liz Rea
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-31 23:11 UTC by Danielle Elder
Modified: 2020-11-30 21:46 UTC (History)
5 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:
20.05.00, 19.11.05, 19.05.10, 18.11.16
Circulation function:


Attachments
Bug 24324: Resolve error with delete_records_via_leader.pl (2.04 KB, patch)
2020-01-03 21:23 UTC, Liz Rea
Details | Diff | Splinter Review
Bug 24324: Resolve error with delete_records_via_leader.pl (2.02 KB, patch)
2020-01-03 21:27 UTC, Liz Rea
Details | Diff | Splinter Review
Bug 24324: Resolve error with delete_records_via_leader.pl (2.14 KB, patch)
2020-03-21 20:51 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
Bug 24324: Resolve error with delete_records_via_leader.pl (2.19 KB, patch)
2020-03-22 13:44 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Danielle Elder 2019-12-31 23:11:21 UTC
This cron gives the following error when run with the -i option but not without.


/usr/share/koha/bin/cronjobs/delete_records_via_leader.pl -c -i -v > /var/lib/koha/redacted/d_leader_deleted_bib.log

The method Koha::Items->itemnumber is not covered by tests!

Trace begun at /usr/share/koha/lib/Koha/Objects.pm line 389
Koha::Objects::AUTOLOAD('Koha::Items=HASH(0x7c1ce60)') called at /usr/share/koha/bin/cronjobs/delete_records_via_leader.pl line 100
Comment 1 Liz Rea 2020-01-03 21:23:57 UTC
Created attachment 96807 [details] [review]
Bug 24324: Resolve error with delete_records_via_leader.pl

To test:

Have a record with the 000 position 5 set to "deleted" (record status)
Use koha-shell to run the job with the -i flag: perl misc/cronjobs/delete_records_via_leader.pl -c -i -v
* items and the record should be deleted
Mark another record with the 000 position 5 set to deleted (record status)
Use koha-shell to run the job without the -i flag: perl misc/cronjobs/delete_records_via_leader.pl -c -v
* if the record had items, it will not be deleted
* if the record did not have items, it will be deleted.
Comment 2 Liz Rea 2020-01-03 21:27:10 UTC
Created attachment 96808 [details] [review]
Bug 24324: Resolve error with delete_records_via_leader.pl

To test:

Have a record with the 000 position 5 set to "deleted" (record status)
Use koha-shell to run the job with the -i flag: perl misc/cronjobs/delete_records_via_leader.pl -c -i -v
* items and the record should be deleted
Mark another record with the 000 position 5 set to deleted (record status)
Use koha-shell to run the job without the -i flag: perl misc/cronjobs/delete_records_via_leader.pl -c -v
* if the record had items, it will not be deleted
* if the record did not have items, it will be deleted.
Comment 3 Bernardo Gonzalez Kriegel 2020-03-21 20:51:28 UTC
Created attachment 101337 [details] [review]
Bug 24324: Resolve error with delete_records_via_leader.pl

To test:

Have a record with the 000 position 5 set to "deleted" (record status)
Use koha-shell to run the job with the -i flag: perl misc/cronjobs/delete_records_via_leader.pl -c -i -v
* items and the record should be deleted
Mark another record with the 000 position 5 set to deleted (record status)
Use koha-shell to run the job without the -i flag: perl misc/cronjobs/delete_records_via_leader.pl -c -v
* if the record had items, it will not be deleted
* if the record did not have items, it will be deleted.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Works ok. Fixed tab char in line 98, no more errors.
Comment 4 Katrin Fischer 2020-03-22 13:44:08 UTC
Created attachment 101370 [details] [review]
Bug 24324: Resolve error with delete_records_via_leader.pl

To test:

Have a record with the 000 position 5 set to "deleted" (record status)
Use koha-shell to run the job with the -i flag: perl misc/cronjobs/delete_records_via_leader.pl -c -i -v
* items and the record should be deleted
Mark another record with the 000 position 5 set to deleted (record status)
Use koha-shell to run the job without the -i flag: perl misc/cronjobs/delete_records_via_leader.pl -c -v
* if the record had items, it will not be deleted
* if the record did not have items, it will be deleted.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Works ok. Fixed tab char in line 98, no more errors.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Martin Renvoize (ashimema) 2020-03-24 09:30:03 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 6 Joy Nelson 2020-04-03 21:32:55 UTC
backported to 19.11.x for 19.11.05
Comment 7 Lucas Gass (lukeg) 2020-04-13 20:08:41 UTC
backported to 19.05.x for 19.05.10
Comment 8 Hayley Pelham 2020-04-19 23:11:33 UTC
Backported to 18.11.x for 18.11.16