[Koha-bugs] [Bug 27729] New: Code around SkipHoldTrapOnNotForLoanValue contains two perl bugs

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Feb 19 11:17:33 CET 2021


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

            Bug ID: 27729
           Summary: Code around SkipHoldTrapOnNotForLoanValue contains two
                    perl bugs
 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: m.de.rooy at rijksmuseum.nl
        QA Contact: testopia at bugs.koha-community.org
                CC: gmcharlt at gmail.com

A few lines of code were added to CheckReserves containing the wrong use of two
perl functions grep and split. A test was added even making these things pass.

grep( $notforloan_per_item, @SkipHoldTrapOnNotForLoanValue )
This does not work. The author hoped that the array was checked for the value
but perl doesnt support that. Use a block with eq test.

split( '|', C4::Context->preference('SkipHoldTrapOnNotForLoanValue') )
Perl split needs a regex but pipe is a special character. It needs escaping.
What this does on -1 is, creating an array of - and 1.
Confusingly, you can use this in javascript.

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


More information about the Koha-bugs mailing list