We want to provide statistics on canceled holds to know if they haven't been picked-up while waiting for the borrower or if the expiration_date on hold have been passed. But if we can see if a hold is waiting in found column of reserves table, this information disappeared from old_reserves table. Found shouldn't be set to Null when cancelling in order to keep this information in old_reserves.
Created attachment 43173 [details] [review] found shouldn't be set to null when cancelling holds
Test plan : - fill syspref ReservesMaxPickUpDelay = 0 - Add a hold and return the item to make it waiting for the borrower - Wait one day or change waitingdate in reserves table to put yesterday date - launch the script /src/misc/cronjobs/holds/cancel_expired_holds.pl You should find your reserve in old_rerseves table with W in column found
Patch tested with a sandbox, by JM Broust <jean-manuel.broust@univ-lyon2.fr>
Created attachment 45775 [details] [review] Bug 14968 - found shouldn't be set to null when cancelling holds Signed-off-by: JM Broust <jean-manuel.broust@univ-lyon2.fr>
Please provide a regression test for this change and provide use case. Why do you want to look at this value when the reserve has been removed (just a curious question :))?
Hi Jonathan, I think it's for statistics: filled vs. cancelled holds.
Yes, we want to have statistics to know if holds have been cancelled because they have never been available or because they've not been picked up by the borrower. We can also imagine having different notices to warn borrowers that their holds have been cancelled : text can be different if the document isn't available or if the document was waiting but the borrowers didn't come to take it in time.
Created attachment 52431 [details] [review] Bug 14968 - Provides unit test
Patch tested with a sandbox, by Broust <jean-manuel.broust@univ-lyon2.fr>
Created attachment 52941 [details] [review] Bug 14968 - found shouldn't be set to null when cancelling holds Signed-off-by: JM Broust <jean-manuel.broust@univ-lyon2.fr> Signed-off-by: Broust <jean-manuel.broust@univ-lyon2.fr>
Created attachment 52942 [details] [review] Bug 14968 - Provides unit test Signed-off-by: Broust <jean-manuel.broust@univ-lyon2.fr>
Created attachment 53015 [details] [review] Bug 14968 - found shouldn't be set to null when cancelling holds Signed-off-by: JM Broust <jean-manuel.broust@univ-lyon2.fr> Signed-off-by: Broust <jean-manuel.broust@univ-lyon2.fr> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 53016 [details] [review] Bug 14968 - Provides unit test Signed-off-by: Broust <jean-manuel.broust@univ-lyon2.fr> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Pushed to master for 16.11, thanks Lyon 3, Alex!
Pushed in 16.05. Will be in 16.05.02.
Patches pushed to 3.22.x, will be in 3.22.10