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.
Created attachment 117060 [details] [review] Bug 27729: Fix use of grep and split in CheckReserves A few lines of code were added to CheckReserves containing the wrong use of two perl functions: grep and split on bug 25232. A test was added even making these things pass. Test plan: Run t/db../Holds.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 117075 [details] [review] Bug 27729: Fix use of grep and split in CheckReserves A few lines of code were added to CheckReserves containing the wrong use of two perl functions: grep and split on bug 25232. A test was added even making these things pass. Test plan: Run t/db../Holds.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 117170 [details] [review] Bug 27729: Fix use of grep and split in CheckReserves A few lines of code were added to CheckReserves containing the wrong use of two perl functions: grep and split on bug 25232. A test was added even making these things pass. Test plan: Run t/db../Holds.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Oops.. easily done.. Works as expected, thanks for the fix. Passing QA
Pushed to master for 21.05, thanks to everybody involved!
Pushed to 20.11.x for 20.11.04
Pushed to 20.05.x for 20.05.10
Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed.