From fa28d2a17ce1688da44924a2cf4ae2184d82375d Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 4 Jul 2023 15:48:00 +0200 Subject: [PATCH] Bug 32496: Some fixes This can be squashed Signed-off-by: Jonathan Druart Signed-off-by: Katrin Fischer Signed-off-by: Marcel de Rooy Signed-off-by: Tomas Cohen Arazi --- Koha/REST/V1/Checkouts.pm | 2 +- t/db_dependent/Circulation/issue.t | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Koha/REST/V1/Checkouts.pm b/Koha/REST/V1/Checkouts.pm index e94d027e49..a7749f1210 100644 --- a/Koha/REST/V1/Checkouts.pm +++ b/Koha/REST/V1/Checkouts.pm @@ -263,7 +263,7 @@ sub add { } # Call 'AddIssue' - my $checkout = AddIssue( $patron->unblessed, $item->barcode ); + my $checkout = AddIssue( $patron, $item->barcode ); if ($checkout) { $c->res->headers->location( $c->req->url->to_string . '/' . $checkout->id ); diff --git a/t/db_dependent/Circulation/issue.t b/t/db_dependent/Circulation/issue.t index e222f33736..2e108c770d 100755 --- a/t/db_dependent/Circulation/issue.t +++ b/t/db_dependent/Circulation/issue.t @@ -598,17 +598,17 @@ my $itemnumber4 = Koha::Item->new( )->store->itemnumber; t::lib::Mocks::mock_preference( 'UpdateNotForLoanStatusOnCheckout', q{} ); -AddIssue( $borrower_2, 'barcode_6', dt_from_string ); +AddIssue( $patron_2, 'barcode_6', dt_from_string ); $item = Koha::Items->find( $itemnumber4 ); ok( $item->notforloan eq -1, 'UpdateNotForLoanStatusOnCheckout does not modify value when not enabled' ); t::lib::Mocks::mock_preference( 'UpdateNotForLoanStatusOnCheckout', '-1: 0' ); AddReturn( 'barcode_6', $branchcode_1 ); -my $test = AddIssue( $borrower_2, 'barcode_6', dt_from_string ); +my $test = AddIssue( $patron_2, 'barcode_6', dt_from_string ); $item = Koha::Items->find( $itemnumber4 ); ok( $item->notforloan eq 0, q{UpdateNotForLoanStatusOnCheckout updates notforloan value from -1 to 0 with setting "-1: 0"} ); -AddIssue( $borrower_2, 'barcode_6', dt_from_string ); +AddIssue( $patron_2, 'barcode_6', dt_from_string ); AddReturn( 'barcode_6', $branchcode_1 ); $item = Koha::Items->find( $itemnumber4 ); ok( $item->notforloan eq 0, q{UpdateNotForLoanStatusOnCheckout does not update notforloan value from 0 with setting "-1: 0"} ); -- 2.39.5