@@ -, +, @@ $ kshell k$ prove t/db_dependent/Koha/Plugins/Circulation_hooks.t --- C4/Circulation.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/C4/Circulation.pm +++ a/C4/Circulation.pm @@ -2124,7 +2124,7 @@ sub AddReturn { my $lookahead= C4::Context->preference('ConfirmFutureHolds'); #number of days to look for future holds ($resfound, $resrec, undef) = C4::Reserves::CheckReserves( $item->itemnumber, undef, $lookahead ) unless ( $item->withdrawn ); # if a hold is found and is waiting at another branch, change the priority back to 1 and trigger the hold (this will trigger a transfer and update the hold status properly) - if ( $resfound eq "Waiting" and $branch ne $resrec->{branchcode} ) { + if ( $resfound and $resfound eq "Waiting" and $branch ne $resrec->{branchcode} ) { my $hold = C4::Reserves::RevertWaitingStatus( { itemnumber => $item->itemnumber } ); $resfound = 'Reserved'; $resrec = $hold->unblessed; @@ -2206,7 +2206,7 @@ sub AddReturn { } } - if ( $issue ) { + if ( $doreturn and $issue ) { my $checkin = Koha::Old::Checkouts->find($issue->id); Koha::Plugins->call('after_circ_action', { --