Bug 24324

Summary: delete_records_via_leader.pl cron error with item deletion
Product: Koha Reporter: Danielle Elder <danielle>
Component: Command-line UtilitiesAssignee: Liz Rea <wizzyrea>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: 1joynelson, bgkriegel, hayleypelham, katrin.fischer, lucas, robin
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:
20.05.00, 19.11.05, 19.05.10, 18.11.16
Attachments: Bug 24324: Resolve error with delete_records_via_leader.pl
Bug 24324: Resolve error with delete_records_via_leader.pl
Bug 24324: Resolve error with delete_records_via_leader.pl
Bug 24324: Resolve error with delete_records_via_leader.pl

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 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 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