Bug 28762: Replace is_notforloan with not_for_loan

This patch replaces the use of is_notforloan with not_for_loan and
removes the older is_notforloan method and tests

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Martin Renvoize 2024-07-22 16:14:08 +01:00
parent 0d5c224cc3
commit 4e6d9d13bf
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
3 changed files with 1 additions and 34 deletions

View File

@ -970,7 +970,7 @@ sub _availability {
my $location = $library ? $library->branchname : '';
my $itemcallnumber = $item->itemcallnumber;
if ( $item->is_notforloan ) {
if ( $item->effective_notforloan ) {
return ( $biblionumber, __('not available'), __('Not for loan'), $location, $itemcallnumber );
} elsif ( $item->onloan ) {
return ( $biblionumber, __('not available'), __('Checked out'), $location, $itemcallnumber );

View File

@ -2398,20 +2398,6 @@ sub check_recalls {
return $recall;
}
=head3 is_notforloan
my $is_notforloan = $item->is_notforloan;
Determine whether or not this item is "notforloan" based on
the item's notforloan status or its item type
=cut
sub is_notforloan {
my ( $self ) = @_;
return $self->not_for_loan;
}
=head3 is_denied_renewal
my $is_denied_renewal = $item->is_denied_renewal;

View File

@ -2242,25 +2242,6 @@ subtest 'Recalls tests' => sub {
$schema->storage->txn_rollback;
};
subtest 'Notforloan tests' => sub {
plan tests => 3;
$schema->storage->txn_begin;
my $item1 = $builder->build_sample_item;
$item1->update({ notforloan => 0 });
$item1->itemtype->notforloan(0);
ok( !$item1->is_notforloan, 'Notforloan is correctly false by item status and item type');
$item1->update({ notforloan => 1 });
ok( $item1->is_notforloan, 'Notforloan is correctly true by item status');
$item1->update({ notforloan => 0 });
$item1->itemtype->update({ notforloan => 1 });
ok( $item1->is_notforloan, 'Notforloan is correctly true by item type');
$schema->storage->txn_rollback;
};
subtest 'item_group() tests' => sub {
plan tests => 4;