[Bug 28740] New: Delete old ILL requests with cleanup_database
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28740 Bug ID: 28740 Summary: Delete old ILL requests with cleanup_database Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Command-line Utilities Assignee: koha-bugs@lists.koha-community.org Reporter: andrew@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: robin@catalyst.net.nz, tomascohen@gmail.com We should teach cleanup_database to delete old ILL requests after a given period. Over in bug 23391, we introduced a syspref in which one can define statuses for which to hide ILL requests. Following that same idea of allowing whatever statuses a given back-end may use, the cron should take a number of days and a status and delete any request with that status that is more than that many days old. -- 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=28740 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |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=28740 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=29109 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28740 Lisette Scheer <lisette.scheer@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lisette.scheer@bywatersolut | |ions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28740 Piia Semenoff <piia.semenoff@ouka.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |piia.semenoff@ouka.fi -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28740 Pedro Amorim <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #1 from Pedro Amorim <pedro.amorim@openfifth.co.uk> --- *** Bug 32629 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28740 Lari Strand <lmstrand@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lmstrand@gmail.com --- Comment #2 from Lari Strand <lmstrand@gmail.com> --- Created attachment 199064 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199064&action=edit Bug 28740: Add option for cleaning up ILL requests This adds two new parameters: --illrequests-status --illrequests-days (optional, defaults to 30 days) These can be repeated to include specific statuses for cleanup. At least one status must be specified. To test: 0 - Apply patch 1 - Create several ILL requests with different statuses (e.g., CANCELLED, REJECTED, COMPLETED, PENDING) 2 - Set some requests to be older than 30 days (update their updated timestamp) 3 - Run cleanup_database.pl with --illrequests-status CANCELLED 4 - CANCELLED requests older than 30 days are removed, others remain 5 - Run cleanup_database.pl with --illrequests-status CANCELLED --illrequests-status REJECTED 6 - Both CANCELLED and REJECTED requests older than 30 days are removed, other statuses remain 7 - Run cleanup_database.pl with --illrequests-days 5 --illrequests-status PENDING 8 - PENDING requests older than 5 days are removed 9 - Verify dry-run mode (no --confirm) correctly counts records that would be deleted without deleting them 10 - Run cleanup_database.pl with --illrequests-days without any --illrequests-status 11 - Error message displayed requiring at least one status to be specified Sponsored-by: Koha-Suomi Oy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28740 Lari Strand <lmstrand@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28740 Irene Tortorella <i.tortorella@arts.ac.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |i.tortorella@arts.ac.uk -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28740 Aude Charillon <aude.charillon@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aude.charillon@openfifth.co | |.uk -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28740 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|tomascohen@gmail.com |lmstrand@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28740 Chip Halvorsen <Chip.Halvorsen@WestlakeLibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |Chip.Halvorsen@WestlakeLibr | |ary.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28740 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |tomascohen@gmail.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=28740 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Sponsorship status|--- |Sponsored Comma delimited| |Koha-Suomi Oy list of Sponsors| | Status|Needs Signoff |Signed Off 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=28740 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #199064|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28740 --- Comment #3 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 203205 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=203205&action=edit Bug 28740: Add option for cleaning up ILL requests This adds two new parameters: --illrequests-status --illrequests-days (optional, defaults to 30 days) These can be repeated to include specific statuses for cleanup. At least one status must be specified. To test: 0 - Apply patch 1 - Create several ILL requests with different statuses (e.g., CANCELLED, REJECTED, COMPLETED, PENDING) 2 - Set some requests to be older than 30 days (update their updated timestamp) 3 - Run cleanup_database.pl with --illrequests-status CANCELLED 4 - CANCELLED requests older than 30 days are removed, others remain 5 - Run cleanup_database.pl with --illrequests-status CANCELLED --illrequests-status REJECTED 6 - Both CANCELLED and REJECTED requests older than 30 days are removed, other statuses remain 7 - Run cleanup_database.pl with --illrequests-days 5 --illrequests-status PENDING 8 - PENDING requests older than 5 days are removed 9 - Verify dry-run mode (no --confirm) correctly counts records that would be deleted without deleting them 10 - Run cleanup_database.pl with --illrequests-days without any --illrequests-status 11 - Error message displayed requiring at least one status to be specified Sponsored-by: Koha-Suomi Oy Signed-off-by: John Doe <tomascohen@gmail.com> edit: tidied the file (tcohen) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28740 --- Comment #4 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 203206 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=203206&action=edit Bug 28740: (follow-up) Add missing C4::Log import for cronlogaction The patch added cronlogaction() calls but did not import the function. This caused a runtime error: Undefined subroutine &main::cronlogaction. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ perl misc/cronjobs/cleanup_database.pl --illrequests-days 30 \ --illrequests-status COMP -v => SUCCESS: Dry-run works, reports count of requests that would be removed 3. Run with --confirm to actually purge 4. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28740 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.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=28740 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |43234 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com Text to go in the| |This enhancement adds release notes| |options to the database | |clean up script | |(misc/cronjobs/cleanup_data | |base.pl) for deleting ILL | |requests: | | | |The two new parameters for | |deleting ILL requests are: | |--illrequests-status* | |--illrequests-days | |(optional, defaults to 30 | |days) | | | |* The ILL status codes are | |defined in the backends, | |with additional aliases | |configured using the | |ILL_STATUS_ALIAS authorized | |value category. The | |Standard backend status | |codes are listed in the | |manual | |https://koha-community.org/ | |manual/latest/en/html/ILL_r | |equests.html#request-status | |es Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43234 [Bug 43234] Move ILL request purging logic to Koha::ILL::Requests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28740 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |26.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=28740 --- Comment #5 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- Thanks everyone! Pushed to main for 26.11! -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org