Bug 40044

Summary: purge_suggestions.pl deletes ongoing suggestions
Product: Koha Reporter: Marion Durand <marion.durand>
Component: Command-line UtilitiesAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: robin
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Marion Durand 2025-06-02 09:21:48 UTC
The cronjob purge_suggestions.pl deletes all suggestions that are older than the parameter (--days or syspref PurgeSuggestionsOlderThan) and that are in any other status than 'ASKED' (due to the use of function C4::Suggestions::DelSuggestionsOlderThan). 

This can lead to delete suggestions on an ongoing order (status ORDERED) or suggestions that have been accepted but not ordered yet (status ACCEPTED).

We should limit (or add an option to limit) this script to REJECTED or AVAILABLE suggestions, as these are suggestions at the end of the process.