Bug 28210: Pass skip_record_index through LostItem

This patch restores the skip_record_index optional parameter for
LostItem and passes it through to MarkIssueReturned as required.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Martin Renvoize 2021-04-23 16:48:52 +01:00 committed by Jonathan Druart
parent 9dbe57b564
commit 00883fc411

View file

@ -3815,12 +3815,21 @@ sub ReturnLostItem{
=head2 LostItem
LostItem( $itemnumber, $mark_lost_from, $force_mark_returned );
LostItem( $itemnumber, $mark_lost_from, $force_mark_returned, [$params] );
The final optional parameter, C<$params>, expected to contain
'skip_record_index' key, which relayed down to Koha::Item/store,
there it prevents calling of ModZebra index_records,
which takes most of the time in batch adds/deletes: index_records better
to be called later in C<additem.pl> after the whole loop.
$params:
skip_record_index => 1|0
=cut
sub LostItem{
my ($itemnumber, $mark_lost_from, $force_mark_returned) = @_;
my ($itemnumber, $mark_lost_from, $force_mark_returned, $params) = @_;
unless ( $mark_lost_from ) {
# Temporary check to avoid regressions
@ -3866,7 +3875,7 @@ sub LostItem{
#warn " $issues->{'borrowernumber'} / $itemnumber ";
}
MarkIssueReturned($borrowernumber,$itemnumber,undef,$patron->privacy) if $mark_returned;
MarkIssueReturned($borrowernumber,$itemnumber,undef,$patron->privacy,$params) if $mark_returned;
}
# When an item is marked as lost, we should automatically cancel its outstanding transfers.