Bug 41449

Summary: Reserves.t may fail when on shelf holds are restricted
Product: Koha Reporter: Marcel de Rooy <m.de.rooy>
Component: Test SuiteAssignee: Marcel de Rooy <m.de.rooy>
Status: Signed Off --- QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low    
Version: Main   
Hardware: All   
OS: All   
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

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