diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 29e06c8234..b12d7a5af2 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -829,9 +829,9 @@ sub CanBookBeIssued { } ); my $block_lost_return = C4::Context->preference("BlockReturnOfLostItems") ? 1 : 0; - my ( $stats_return, $stats_messages, $stats_iteminformation, $stats_borrower) = - AddReturn( $item_object->barcode, C4::Context->userenv->{'branch'} ); - ModDateLastSeen( $item_object->itemnumber, $block_lost_return ); # FIXME Move to Koha::Item + my ( $stats_return, $stats_messages, $stats_iteminformation, $stats_borrower ) = + AddReturn( $item_object->barcode, C4::Context->userenv->{'branch'} ); + ModDateLastSeen( $item_object->itemnumber, $block_lost_return ); # FIXME Move to Koha::Item return ( { STATS => 1, diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t index 9396be44c2..4caaa43d02 100755 --- a/t/db_dependent/Circulation.t +++ b/t/db_dependent/Circulation.t @@ -2317,17 +2317,17 @@ subtest 'CanBookBeIssued + Statistic patrons "X"' => sub { is( $stat->categorycode, $patron->categorycode, 'Recorded a categorycode' ); is( $stat->location, $item_1->location, 'Recorded a location' ); - - t::lib::Mocks::mock_userenv({ branchcode => $library->branchcode }); - my $patron_2 = $builder->build_object( { class => 'Koha::Patrons', value => { categorycode => $patron_category->{categorycode} } } ); + t::lib::Mocks::mock_userenv( { branchcode => $library->branchcode } ); + my $patron_2 = $builder->build_object( + { class => 'Koha::Patrons', value => { categorycode => $patron_category->{categorycode} } } ); my $item_2 = $builder->build_sample_item( { library => $library->branchcode } ); - my $issue = AddIssue( $patron_2, $item_2->barcode ); + my $issue = AddIssue( $patron_2, $item_2->barcode ); $item_2->discard_changes; - ok($item_2->onloan, "Item is checked out"); + ok( $item_2->onloan, "Item is checked out" ); ( $error, $question, $alerts ) = CanBookBeIssued( $patron, $item_2->barcode ); $item_2->discard_changes; - ok(!$item_2->onloan, "Checked out item is returned"); + ok( !$item_2->onloan, "Checked out item is returned" ); # TODO There are other tests to provide here };