https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43953

--- Comment #1 from Martin Renvoize (ashimema) 
<[email protected]> ---
Created attachment 210031
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210031&action=edit
Bug 43953: Holds API PATCH ignores AllowHoldDateInFuture when changing
hold_date

POST /api/v1/holds refuses a hold_date when AllowHoldDateInFuture is off,
but PATCH/PUT /api/v1/holds/{hold_id} passed a changed hold_date straight
to ModReserve. The staff holds table hides the hold date input when the
preference is off, but the API did not enforce it.

Return a 400 from edit() when the hold date would change and
AllowHoldDateInFuture is off. Sending back the existing hold date is
still accepted, so clients that send the whole object keep working.

To test:
1. Set AllowHoldDateInFuture to "Don't allow"
2. prove t/db_dependent/api/v1/holds.t
   => FAIL without the patch, in the edit() tests
3. Apply the patch and run the test again
   => SUCCESS
4. Optionally, send PATCH /api/v1/holds/<id> with
   {"hold_date": "2030-01-01"} as a user with place_holds:
   a 400 is returned and the hold is unchanged. Turn the preference on
   and the same request succeeds.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to