Koha-clms/Koha/REST
Tomas Cohen Arazi 82e0edd876
Bug 35053: Make sure request is checked as an item-level request if item_id passed
This patch makes the validation code have the `$item` variable defined
when checking holdability, in the case both `item_id` and `biblio_id`
params are passed.

Otherwise, if the requested item is not holdable, but a biblio-level
hold *could* be placed, the item-level hold is placed.

This is highlighted by the regression tests.

To test:
1. Apply the regression tests patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/holds.t
=> FAIL: Tests don't pass. A request that should be rejected is allowed
because biblio-level hold is allowed.
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass! Item-level rules are checked and thus the
request rejected (code 403)
5. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-20 11:02:55 -03:00
..
Plugin Bug 33556: Path parameters are handled explicitly in the controllers 2023-07-21 17:14:36 -03:00
V1 Bug 35053: Make sure request is checked as an item-level request if item_id passed 2023-10-20 11:02:55 -03:00
V1.pm Bug 34271: Remove a few Logger statements from REST API 2023-10-18 10:26:03 -03:00