Bug 23010: Update pref name to PreventWithdrawingItemsStatus

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit c4acafe29b)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This commit is contained in:
Lucas Gass 2025-04-22 22:24:23 +00:00 committed by Paul Derscheid
parent 22b32b2814
commit af9615f3d9
No known key found for this signature in database
GPG Key ID: C25F9FD44CED595B
3 changed files with 7 additions and 7 deletions

View File

@ -188,7 +188,7 @@ sub store {
}
}
my $prevent_withdrawing_of = C4::Context->preference('PreventWithDrawingItemsStatus');
my $prevent_withdrawing_of = C4::Context->preference('PreventWithdrawingItemsStatus');
my @statuses_to_prevent = defined $prevent_withdrawing_of ? split( ',', $prevent_withdrawing_of ) : ();
my $prevent_onloan = grep { $_ eq 'checkedout' } @statuses_to_prevent;
my $prevent_intransit = grep { $_ eq 'intransit' } @statuses_to_prevent;

View File

@ -3,7 +3,7 @@ use Koha::Installer::Output qw(say_warning say_success say_info);
return {
bug_number => "23010",
description => "Add new PreventWithDrawingItemsStatus system preference",
description => "Add new PreventWithdrawingItemsStatus system preference",
up => sub {
my ($args) = @_;
my ( $dbh, $out ) = @$args{qw(dbh out)};
@ -11,10 +11,10 @@ return {
$dbh->do(
q{
INSERT IGNORE INTO systempreferences (`variable`,`value`,`options`,`explanation`,`type`)
VALUES ('PreventWithDrawingItemsStatus',NULL,'','Prevent the withdrawing of items based on statuses','Choice')
VALUES ('PreventWithdrawingItemsStatus',NULL,'','Prevent the withdrawing of items based on statuses','Choice')
}
);
say $out "Added new system preference 'PreventWithDrawingItemsStatus'";
say $out "Added new system preference 'PreventWithdrawingItemsStatus'";
},
};

View File

@ -191,11 +191,11 @@ subtest '_status() tests' => sub {
$schema->storage->txn_rollback;
};
subtest 'store PreventWithDrawingItemsStatus' => sub {
subtest 'store PreventWithdrawingItemsStatus' => sub {
plan tests => 2;
$schema->storage->txn_begin;
t::lib::Mocks::mock_preference( 'PreventWithDrawingItemsStatus', 'intransit,checkedout' );
t::lib::Mocks::mock_preference( 'PreventWithdrawingItemsStatus', 'intransit,checkedout' );
my $library_1 = $builder->build( { source => 'Branch' } );
my $library_2 = $builder->build( { source => 'Branch' } );
@ -238,7 +238,7 @@ subtest 'store PreventWithDrawingItemsStatus' => sub {
'Koha::Exceptions::Item::Transfer::InTransit',
'Exception thrown when trying to withdraw item in transit';
t::lib::Mocks::mock_preference( 'PreventWithDrawingItemsStatus', '' );
t::lib::Mocks::mock_preference( 'PreventWithdrawingItemsStatus', '' );
$schema->storage->txn_rollback;
};