[Koha-bugs] [Bug 35053] Item-level rules not checked if both item_id and biblio_id are passed
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Thu Oct 19 09:26:32 CEST 2023
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35053
David Nind <david at davidnind.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #157232|0 |1
is obsolete| |
--- Comment #4 from David Nind <david at davidnind.com> ---
Created attachment 157390
-->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=157390&action=edit
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 at davidnind.com>
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list