Bugzilla – Attachment 106199 Details for
Bug 25232
Add ability to skip triggering holds with a given notforloan value
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25232: Add ability to specify multiple notforloan values to skip
Bug-25232-Add-ability-to-specify-multiple-notforlo.patch (text/plain), 3.39 KB, created by
ByWater Sandboxes
on 2020-06-23 10:28:32 UTC
(
hide
)
Description:
Bug 25232: Add ability to specify multiple notforloan values to skip
Filename:
MIME Type:
Creator:
ByWater Sandboxes
Created:
2020-06-23 10:28:32 UTC
Size:
3.39 KB
patch
obsolete
>From 1575d703ae726f03240efd636310d273773417b6 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 7 May 2020 09:16:37 -0400 >Subject: [PATCH] Bug 25232: Add ability to specify multiple notforloan values > to skip > >Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> >--- > C4/Reserves.pm | 4 ++-- > .../intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref | 3 ++- > t/db_dependent/Holds.t | 4 +++- > 3 files changed, 7 insertions(+), 4 deletions(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index fb7aba2527..2c17d53235 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -794,8 +794,8 @@ sub CheckReserves { > # if item is not for loan it cannot be reserved either..... > # except where items.notforloan < 0 : This indicates the item is holdable. > >- my $SkipHoldTrapOnNotForLoanValue = C4::Context->preference('SkipHoldTrapOnNotForLoanValue'); >- return if $SkipHoldTrapOnNotForLoanValue && $notforloan_per_item eq $SkipHoldTrapOnNotForLoanValue; >+ my @SkipHoldTrapOnNotForLoanValue = split( '|', C4::Context->preference('SkipHoldTrapOnNotForLoanValue') ); >+ return if @SkipHoldTrapOnNotForLoanValue && grep( $notforloan_per_item, @SkipHoldTrapOnNotForLoanValue ); > > my $dont_trap = C4::Context->preference('TrapHoldsOnOrder') ? ($notforloan_per_item > 0) : ($notforloan_per_item && 1 ); > return if $dont_trap or $notforloan_per_itemtype; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >index 0fd5438592..f2379e797e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >@@ -527,10 +527,11 @@ Circulation: > no: "Don't trap" > - items that are not for loan but holdable ( notforloan < 0 ) to fill holds. > - >- - Never trap items with a 'not for loan' value of >+ - Never trap items with 'not for loan' values of > - pref: SkipHoldTrapOnNotForLoanValue > class: integer > - to fill holds. >+ - "(list of not for loan values separated with a pipe '|')" > - > - pref: HoldsAutoFill > choices: >diff --git a/t/db_dependent/Holds.t b/t/db_dependent/Holds.t >index a82fa5312f..bf9540573c 100755 >--- a/t/db_dependent/Holds.t >+++ b/t/db_dependent/Holds.t >@@ -7,7 +7,7 @@ use t::lib::TestBuilder; > > use C4::Context; > >-use Test::More tests => 65; >+use Test::More tests => 66; > use MARC::Record; > > use C4::Biblio; >@@ -365,6 +365,8 @@ t::lib::Mocks::mock_preference( 'TrapHoldsOnOrder', 1 ); > ok( defined( ( CheckReserves($itemnumber) )[1] ), "Hold is trapped for item that is not for loan but holdable ( notforloan < 0 )" ); > t::lib::Mocks::mock_preference( 'SkipHoldTrapOnNotForLoanValue', '-1' ); > ok( !defined( ( CheckReserves($itemnumber) )[1] ), "Hold cannot be trapped for item with notforloan value matching SkipHoldTrapOnNotForLoanValue" ); >+t::lib::Mocks::mock_preference( 'SkipHoldTrapOnNotForLoanValue', '-1|1' ); >+ok( !defined( ( CheckReserves($itemnumber) )[1] ), "Hold cannot be trapped for item with notforloan value matching SkipHoldTrapOnNotForLoanValue" ); > $hold->delete(); > > # Regression test for bug 9532 >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 25232
:
103400
|
104512
|
106198
|
106199
|
106202
|
106203