=head2 LostItem
- 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
+ LostItem( $itemnumber, $mark_lost_from, $force_mark_returned );
=cut
sub LostItem{
- my ($itemnumber, $mark_lost_from, $force_mark_returned, $params) = @_;
+ my ($itemnumber, $mark_lost_from, $force_mark_returned) = @_;
unless ( $mark_lost_from ) {
# Temporary check to avoid regressions
};
subtest 'Test indexer calls' => sub {
- plan tests => 40;
+ plan tests => 36;
my @engines = ('Zebra');
eval { Koha::SearchEngine::Elasticsearch->get_elasticsearch_params; };
AddReturn($item->barcode, $item->homebranch, 0, undef);
} [$engine,'C4::Circulation'], "index_records is called once for $engine when calling AddReturn if item not issued";
- $builder->build(
- {
- source => 'Branchtransfer',
- value => {
- itemnumber => $item->itemnumber,
- datesent => dt_from_string,
- datearrived => undef,
- datecancelled => undef
- }
- }
- );
- warnings_are{
- LostItem( $item->itemnumber, "tests");
- } [$engine,"Koha::Item"], "index_records is called for $engine when calling LostItem and transfer exists";
- $builder->build(
- {
- source => 'Branchtransfer',
- value => {
- itemnumber => $item2->itemnumber,
- datesent => dt_from_string,
- datearrived => undef,
- datecancelled => undef
- }
- }
- );
- warnings_are{
- LostItem( $item->itemnumber, "tests", undef, { skip_record_index => 1 });
- } undef, "index_records is not called for $engine when calling LostItem and transfer exists if skip_record_index";
-
$item->datelastseen('2020-02-02');
$item->store({skip_record_index=>1});
warnings_are{