[Bug 35654] New: Add option to delete last item to delete_items.pl
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 Bug ID: 35654 Summary: Add option to delete last item to delete_items.pl Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Cataloging Assignee: koha-bugs@lists.koha-community.org Reporter: enica@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: m.de.rooy@rijksmuseum.nl Apologies if there's a duplicate bug. It would be great to add a parameter to delete_items.pl to delete the record if the last item getting deleted is the only one that remains. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 Magnus Enger <magnus@libriotech.no> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |magnus@libriotech.no --- Comment #1 from Magnus Enger <magnus@libriotech.no> --- Sorry, what steps do you take to get to delete_items.pl? -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 --- Comment #2 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- It's a CLI script in misc/cronjobs :) -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 Enica Davis <enica@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Add option to delete last |Add option to |item to delete_items.pl |delete_items.pl to delete | |record if existing item | |getting deleted is the only | |one attached to the bib -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 Angela Berrett <angela.berrett@familysearch.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |angela.berrett@familysearch | |.org --- Comment #3 from Angela Berrett <angela.berrett@familysearch.org> --- Would this be optional or be coded to always happen? We would definitely want to choose when to delete the record or not. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 --- Comment #4 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Hi Angela, I believe that this was filed with the idea to make it an option for the CLI script, so you'd add it or not as needed, similar to how you can check the checkbox in the GUI or leave it off. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrew@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 Michelle Spinney <mspinney@clamsnet.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mspinney@clamsnet.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 Brendan Lawlor <blawlor@clamsnet.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 --- Comment #5 from Brendan Lawlor <blawlor@clamsnet.org> --- Created attachment 174480 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=174480&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 -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #174480|0 |1 is obsolete| | --- Comment #6 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 174529 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=174529&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 <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 --- Comment #7 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 175193 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=175193&action=edit Bug 35654: (follow-up) Simplify variable use and only delete when commit is set This patch leans up some things: - version option does nothing, so removed - warn when not setting commit and show conditional messages - remove use of Koha::Biblios and use item object methods -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 --- Comment #8 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 175194 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=175194&action=edit Bug 35654: Simplify and update delete_items.pl code Rather than defining hashes and storing our options there, we can just use variables directly, improves readability IMO -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 --- Comment #9 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 175195 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=175195&action=edit Bug 35654: Use Koha::Items instead of direct SQL -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |blawlor@clamsnet.org |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 --- Comment #10 from Brendan Lawlor <blawlor@clamsnet.org> --- Created attachment 175208 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=175208&action=edit Bug 35654: (follow-up) Remove unneeded code and comment This patch removes old code that was used for direct SQL -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 --- Comment #11 from Brendan Lawlor <blawlor@clamsnet.org> --- Created attachment 175209 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=175209&action=edit Bug 35654: (follow-up) Fix $holdings_count Fix the off by one error in the holdings_count to accurately print the number of remaining items. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 Emily Lamancusa (emlam) <emily.lamancusa@montgomerycountymd.gov> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |emily.lamancusa@montgomeryc | |ountymd.gov --- Comment #12 from Emily Lamancusa (emlam) <emily.lamancusa@montgomerycountymd.gov> --- Is "Signed off" still the right status for this bug? It looks like 5 follow-ups have been added since it was signed off, some of which contain refactoring that seems out of scope to me... I should be able to QA this if Nick isn't planning on it, but I'd want another signoff and ideally some commit cleanup first (or clarity on why it isn't needed). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 Brendan Lawlor <blawlor@clamsnet.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Needs Signoff --- Comment #13 from Brendan Lawlor <blawlor@clamsnet.org> --- Thanks for looking at this Emily! I think I should have probably changed the status back to needs sign off when I added the last two patches. I'm not sure how to best clean up the commits because some are from me and some from Nick. The commit messages describe the changes they are making and make sense to me, but I understand how they could be confusing and it would be clearer to look at this as a whole if they were squashed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 Brendan Lawlor <blawlor@clamsnet.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 Brendan Lawlor <blawlor@clamsnet.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #174529|0 |1 is obsolete| | Attachment #175193|0 |1 is obsolete| | Attachment #175194|0 |1 is obsolete| | Attachment #175195|0 |1 is obsolete| | Attachment #175208|0 |1 is obsolete| | Attachment #175209|0 |1 is obsolete| | --- Comment #14 from Brendan Lawlor <blawlor@clamsnet.org> --- Created attachment 176936 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=176936&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 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 --- Comment #15 from Brendan Lawlor <blawlor@clamsnet.org> --- I squashed everything into one commit and removed Andrew's sign off line. Thanks for your help Nick! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #176936|0 |1 is obsolete| | --- Comment #16 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 176937 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=176937&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 <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Patch doesn't apply CC| |lucas@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #176937|0 |1 is obsolete| | --- Comment #17 from Jonathan Druart <jonathan.druart@gmail.com> --- 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 <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@gmail.com --- Comment #18 from Jonathan Druart <jonathan.druart@gmail.com> --- Patch rebased using the auto-rebase script. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #19 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- FAIL misc/cronjobs/delete_items.pl FAIL critic # Variables::ProhibitConditionalDeclarations: Got 1 violation(s). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 Brendan Lawlor <blawlor@clamsnet.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 Brendan Lawlor <blawlor@clamsnet.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #177868|0 |1 is obsolete| | --- Comment #20 from Brendan Lawlor <blawlor@clamsnet.org> --- Created attachment 179675 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=179675&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 <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 --- Comment #21 from Brendan Lawlor <blawlor@clamsnet.org> --- Thanks Marcel, I fixed that QA violation -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA CC| |kyle@bywatersolutions.com --- Comment #22 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- I'm getting an error while testing: kohadev-koha@kohadevbox:koha(bug35654-qa)$ ./misc/cronjobs/delete_items.pl --where "items.withdrawn = 0" --verbose --commit --del_bibs Where statement: items.withdrawn = 0 Deleting bibliographic records when all items are deleted! DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Unknown column 'items.withdrawn' in 'where clause' at /kohadevbox/koha/Koha/Objects.pm line 319 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 --- Comment #23 from Emily Lamancusa (emlam) <emily.lamancusa@montgomerycountymd.gov> --- Oh, since the code is using a Koha::Items->search instead of a direct database query now, it doesn't recognize items.withdrawn - it would need to be me.withdrawn. (Noticed this because I had this exact problem with a different cron job recently!) If we're going to switch from SQL to Items->search, we should make sure to explain that in the release notes at minimum, since it would break existing installations that do have fully qualified where conditions like that. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 Brendan Lawlor <blawlor@clamsnet.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 --- Comment #24 from Brendan Lawlor <blawlor@clamsnet.org> --- Created attachment 185416 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=185416&action=edit Bug 35654: (follow-up) Update example script to be compatible with change to using Koha::Items Since this patch updates the script to use Koha::Items->search instead of a direct database query --where options that refer to the items table will be broken and result in an error like: execute failed: Unknown column 'items.withdrawn' in 'where clause' -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 --- Comment #25 from Brendan Lawlor <blawlor@clamsnet.org> --- Thanks Emily! That's exactly the issue. I hadn't tested with using the table name in the where clause so this never came up before. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 Brendan Lawlor <blawlor@clamsnet.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This patch updates the release notes| |delete_items script to use | |Koha::Items->search instead | |of a direct database query. | | | |Using a --where option that | |refers to the items table | |by name such as: | |./misc/cronjobs/delete_item | |s.pl --where | |"items.withdrawn = 0" | | | |will no longer work and | |result in an error: | |execute failed: Unknown | |column 'items.withdrawn' in | |'where clause' | | | |Use the --where option | |without naming the items | |table instead: | |./misc/cronjobs/delete_item | |s.pl --where "withdrawn = | |0" -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #179675|0 |1 is obsolete| | --- Comment #26 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 185425 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=185425&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 <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #185416|0 |1 is obsolete| | --- Comment #27 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 185426 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=185426&action=edit Bug 35654: (follow-up) Update example script to be compatible with change to using Koha::Items Since this patch updates the script to use Koha::Items->search instead of a direct database query --where options that refer to the items table will be broken and result in an error like: execute failed: Unknown column 'items.withdrawn' in 'where clause' Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |kyle@bywatersolutions.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #185425|0 |1 is obsolete| | --- Comment #28 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 185539 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=185539&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 <andrew@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #185426|0 |1 is obsolete| | --- Comment #29 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 185540 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=185540&action=edit Bug 35654: (follow-up) Update example script to be compatible with change to using Koha::Items Since this patch updates the script to use Koha::Items->search instead of a direct database query --where options that refer to the items table will be broken and result in an error like: execute failed: Unknown column 'items.withdrawn' in 'where clause' Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |25.11.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 --- Comment #30 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Nice work everyone! Pushed to main for 25.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|25.11.00 |25.11.00,25.05.04 released in| | Status|Pushed to main |Pushed to stable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 --- Comment #31 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Nice work everyone! Pushed to 25.05.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Needs documenting CC| |fridolin.somers@biblibre.co | |m --- Comment #32 from Fridolin Somers <fridolin.somers@biblibre.com> --- Enhancement not pushed to 24.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 Brendan Lawlor <blawlor@clamsnet.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Documentation| |https://gitlab.com/koha-com submission| |munity/koha-manual/-/merge_ | |requests/1116 Documentation| |Brendan Lawlor contact| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35654 Brendan Lawlor <blawlor@clamsnet.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Needs documenting |RESOLVED -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org