https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654
Jonathan Druart <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #176937|0 |1 is obsolete| | --- Comment #17 from Jonathan Druart <[email protected]> --- Created attachment 177868 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=177868&action=edit Bug 35654: Add option to delete_items.pl cronjob to delete empty bibs This patch adds a new option to the delete_items cronjob When --del_bibs is set, bib records will be deleted if the last item is deleted. The following plan assumes default ktd data. To test: 1. Apply patch 2. Check the holdings for bib #115 and see 3 items http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=115 2. Run the cron with the following flags perl ./misc/cronjobs/delete_items.pl --where "biblionumber=115 and homebranch ='MPL'" --verbose --del_bibs --commit 3. Notice in the output the count of current items on the bib record: Where statement: where biblionumber=115 and homebranch='MPL' Deleting empty bib records! Deleting item '237' (of 3) Deleting item '238' (of 2) 4. Confirm the two Midway items were deleted from bib #115, and the bib still exists with one item 4. Run the cron again but change the the --where flag to delete all the items from bib #115 perl ./misc/cronjobs/delete_items.pl --where "biblionumber=115" --verbose --del_bibs --commit 5. Notice in the output the bib is deleted after the last item is deleted Where statement: where biblionumber=115 Deleting empty bib records! Deleting item '239' (of 1) Last item deleted - deleting bib '115' 8. Confirm the bib #115 was deleted 9. Add some more items and test with some other --where parameters 10. Test with and without --commit and --del_bibs, test the --help flag Sponsored-by: CLAMS Signed-off-by: Andrew Fuerste Henry <[email protected]> -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
