action.item_user_circ_test reverted back to old version with 3.10 upgrade

Bug #2024682 reported by Steve Callender
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Medium
Unassigned

Bug Description

The action.item_user_circ_test function to test the availability of a ciculation to the patron used to check the is_available status on the config.copy_status itself, like this,

    -- Fail if the item isn't in a circulateable status on a non-renewal
    IF NOT renewal AND item_object.status <> 8 AND item_object.status NOT IN (
        (SELECT id FROM config.copy_status WHERE is_available) ) THEN
        result.fail_part := 'asset.copy.status';
        result.success := FALSE;
        done := TRUE;
        RETURN NEXT result;
    -- Alternately, fail if the item isn't checked out on a renewal

It looks like the current upgrade scripts to 3.10 reverts that change and goes back to hardcoded values, which is bad,

    -- Fail if the item isn't in a circulateable status on a non-renewal
    IF NOT renewal AND item_object.status NOT IN ( 0, 7, 8 ) THEN
        result.fail_part := 'asset.copy.status';
        result.success := FALSE;
        done := TRUE;
        RETURN NEXT result;

I'm not sure when this old code got put back in there, but it should be corrected.

Revision history for this message
Steve Callender (stevecallender) wrote :

It looks like it happened during LP#1411819

Revision history for this message
Lindsay Stratton (lstratton) wrote :

WLS discovered this, post 3.10 upgrade (from 3.8) with the "ILL" item status - a stock status, that is set to available.

Items with the ILL item status triggered warning/force action on checkout.

Changed in evergreen:
assignee: nobody → Jeff Davis (jdavis-sitka)
Revision history for this message
Jeff Davis (jdavis-sitka) wrote :

Looks like 100.circ_matrix.sql has the correct version of action.item_user_circ_test, but the 3.9.1-3.10.0-upgrade-db.sql version upgrade script has an incorrect version. (There are several discrepancies in addition to the one Steve identified in the original bug report.) At first glance, reverting to the version from 100.circ_matrix.sql ought to fix the issue.

tags: added: regression
Changed in evergreen:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Jeff Davis (jdavis-sitka) wrote (last edit ):

Working branch user/jeffdavis/lp2024682-fix-user-circ-test updates the 3.9.1-3.10.0-upgrade-db.sql version upgrade script to use the correct version of the function, and provides a separate upgrade script for those who have already upgraded to 3.10:

https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/jeffdavis/lp2024682-fix-user-circ-test

I'm not sure if modifying the version upgrade script is the right approach, or if we should leave it as-is and apply the correct version of the function in a subsequent upgrade instead.

Changed in evergreen:
assignee: Jeff Davis (jdavis-sitka) → nobody
Revision history for this message
Jeff Davis (jdavis-sitka) wrote :

Nope, that won't work, because there are changes to user_circ_test in 3.11 that aren't in 3.10.

Changed in evergreen:
assignee: nobody → Jeff Davis (jdavis-sitka)
Revision history for this message
Jeff Davis (jdavis-sitka) wrote :

New working branch user/jeffdavis/lp2024682-fix-user-circ-test-2 has an upgrade script with the correct version of the function for 3.10:

https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/jeffdavis/lp2024682-fix-user-circ-test-2

This branch does not modify the 3.9.1-3.10.0-upgrade-db.sql version upgrade script.

Note that this bug ONLY affects 3.10. The 3.10.2-3.11.0-upgrade-db.sql version upgrade script already fixes the issue for 3.11. So this fix should only be committed to rel_3_10.

Changed in evergreen:
assignee: Jeff Davis (jdavis-sitka) → nobody
tags: added: pullrequest
Changed in evergreen:
milestone: none → 3.10.3
Galen Charlton (gmc)
Changed in evergreen:
assignee: nobody → Galen Charlton (gmc)
Revision history for this message
Galen Charlton (gmc) wrote :

Fix pushed to rel_3_10. Thanks, Jeff!

I've also pushed no-op placeholders for the 1379 DB update to main and rel_3_11 so that any database that is already at 3.11 doesn't have a gap in the DB revision numbering that somebody might try to fill with a forward-port from rel_3_10.

Changed in evergreen:
assignee: Galen Charlton (gmc) → nobody
status: Confirmed → Fix Committed
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.