[Koha-bugs] [Bug 29087] New: Holds to pull list can crash with a SQL::Abstract puke

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Sep 22 23:16:14 CEST 2021


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

            Bug ID: 29087
           Summary: Holds to pull list can crash with a SQL::Abstract puke
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P5 - low
         Component: Hold requests
          Assignee: koha-bugs at lists.koha-community.org
          Reporter: gmcharlt at gmail.com
        QA Contact: testopia at bugs.koha-community.org
                CC: gmcharlt at gmail.com

Opening the holds to pull list page can crash with the following logged error:

  SQL::Abstract::puke(): [SQL::Abstract::__ANON__] Fatal: SQL::Abstract before
v1.75 used to generate incorrect SQL when the -NOT IN operator was given an
undef-containing list: !!!AUDIT YOUR CODE AND DATA!!! (the upcoming
Data::Query-based version of SQL::Abstract will emit the logically correct SQL
instead of raising this exception) at /usr/share/koha/lib/Koha/Objects.pm line
145

I've traced this to Koha::Holds->get_items_that_can_fill(). Among other things,
this routine fetches a list of item types that cannot fill holds, i.e., cases
where the 'holdallowed' rule value is 'not_allowed'.

However, if your default rule is to not allow holds, the
@hold_not_allowed_itypes list will end up including an entry whose value is
undef. When passed to the item query, doing the -not_in filter on itype will
result in the crash listed above.

A quick fix might be to filter out undef from that list. That will fix the
crash, but could lead to incorrect results if the default policy is to deny
holds for all item types except for ones that are going to be specifically
permitted.

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


More information about the Koha-bugs mailing list