[Koha-bugs] [Bug 25556] New: Holds blocked when empty holdallowed value present in circulation_rules

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed May 20 20:20:18 CEST 2020


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25556

            Bug ID: 25556
           Summary: Holds blocked when empty holdallowed value present in
                    circulation_rules
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: minor
          Priority: P5 - low
         Component: Hold requests
          Assignee: stalkernoid at gmail.com
          Reporter: nugged at gmail.com
        QA Contact: testopia at bugs.koha-community.org
                CC: gmcharlt at gmail.com, slavashishkin at gmail.com

Holds blocked ("Cannot place hold" yellow notification window) for default rule
after onboarding.pl (web installation process). 

That happens because /cgi-bin/koha/installer/onboarding.pl script creates the
empty (holdallowed="") key/value pair in the circulation_rules table.

Probably empty ("") holdallowed key assumed to have the same behavior as
undef/NULL, because:

  - in the interface (/cgi-bin/koha/admin/smart-rules.pl) both are interpreted
    as "Not set" (undef or ""),

  - if to remove this empty value for holdallowed from circulation_rules
    table at all (so have it undef) holds allowed and not blocked.

  - in other cases if "holdallowed" has correct values from
    the dropdown list (0, 1, 2, 3) - all works as expected.


I.e.:

  1. ="" has behavior as ="0",

  2. value absence (NULL/undef) has behavior as ="2" ("from any library").

  3. but for both values site interface shows "not set".

This makes confusion: in 1. it blocks holds, and in 2. it allows.

I propose we make both "" and undef work similarly as "not set" in "check if
holds allowed" code, and both to allow holds like undef now does.

And at the same time remove "" creation but use undef instead in the onboarding
process when done first rule creation.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list