AddReturn can be called on an item even if it's not checked out (to
trigger holds for instance).
The hook should (?) not be called in that situation
Test plan:
Confirm the above and that the following tests are now passing:
t/db_dependent/SIP/Message.t
t/db_dependent/Reserves.t
t/db_dependent/Circulation/issue.t
t/db_dependent/SIP/Transaction.t
t/db_dependent/Circulation.t
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
}
}
- my $checkin = Koha::Old::Checkouts->find($issue->id);
+ if ( $issue ) {
+ my $checkin = Koha::Old::Checkouts->find($issue->id);
- Koha::Plugins->call('after_circ_action', {
- action => 'checkin',
- payload => {
- checkout=> $checkin
- }
- });
+ Koha::Plugins->call('after_circ_action', {
+ action => 'checkin',
+ payload => {
+ checkout=> $checkin
+ }
+ });
+ }
return ( $doreturn, $messages, $issue, ( $patron ? $patron->unblessed : {} ));
}