Bug 41449 - Reserves.t may fail when on shelf holds are restricted
Summary: Reserves.t may fail when on shelf holds are restricted
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Marcel de Rooy
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-12-15 11:34 UTC by Marcel de Rooy
Modified: 2025-12-15 11:38 UTC (History)
0 users

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 41449: Reserves.t - fix description and assumption for onshelfholds (1.26 KB, patch)
2025-12-15 11:38 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel de Rooy 2025-12-15 11:34:58 UTC
[1] Around line 1486, it is assumed that onshelfholds == 1. If you set the circ rule to If any unavailabe, the test fails.

t/db_dependent/Reserves.t .. 60/71
    #   Failed test 'Item not available for item-level hold because no effective item type'
    #   at t/db_dependent/Reserves.t line 1486.
    # Looks like you failed 1 test of 3.

=> Fix that assumption. Note btw that the lines following the error, onshelfholds is set to 0.

[2] The test description is misleading and incorrect (copied from an earlier one, not adjusted)
     ok(
        C4::Reserves::IsAvailableForItemLevelRequest( $item, $patron ),
        "Item not available for item-level hold because no effective item type"
    );
=> The item is available because '0' is defined.
Comment 1 Marcel de Rooy 2025-12-15 11:38:03 UTC
Created attachment 190496 [details] [review]
Bug 41449: Reserves.t - fix description and assumption for onshelfholds

Test plan:
prove t/db_dependent/Reserves.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 2 Marcel de Rooy 2025-12-15 11:38:36 UTC
Trivial test change. Self SO