View | Details | Raw Unified | Return to bug 25265
Collapse All | Expand All

(-)a/C4/Items.pm (-4 / +17 lines)
Lines 281-290 sub AddItemBatchFromMarc { Link Here
281
    return (\@itemnumbers, \@errors);
281
    return (\@itemnumbers, \@errors);
282
}
282
}
283
283
284
=head2 ModItemFromMarc
285
286
my $item = ModItemFromMarc($item_marc, $biblionumber, $itemnumber[, $params]);
287
288
The final optional parameter, C<$params>, expected to contain
289
'skip_modzebra_update' key, which relayed down to Koha::Item/store,
290
there it prevents calling of ModZebra (and Elasticsearch update),
291
which takes most of the time in batch adds/deletes: ModZebra better
292
to be called later in C<additem.pl> after the whole loop.
293
294
$params:
295
    skip_modzebra_update => 1|0
296
297
=cut
298
284
sub ModItemFromMarc {
299
sub ModItemFromMarc {
285
    my $item_marc = shift;
300
    my ( $item_marc, $biblionumber, $itemnumber, $params ) @_;
286
    my $biblionumber = shift;
287
    my $itemnumber = shift;
288
301
289
    my $frameworkcode = C4::Biblio::GetFrameworkCode($biblionumber);
302
    my $frameworkcode = C4::Biblio::GetFrameworkCode($biblionumber);
290
    my ( $itemtag, $itemsubfield ) = C4::Biblio::GetMarcFromKohaField( "items.itemnumber" );
303
    my ( $itemtag, $itemsubfield ) = C4::Biblio::GetMarcFromKohaField( "items.itemnumber" );
Lines 313-319 sub ModItemFromMarc { Link Here
313
    $item_object = $item_object->set_or_blank($item);
326
    $item_object = $item_object->set_or_blank($item);
314
    my $unlinked_item_subfields = _get_unlinked_item_subfields( $localitemmarc, $frameworkcode );
327
    my $unlinked_item_subfields = _get_unlinked_item_subfields( $localitemmarc, $frameworkcode );
315
    $item_object->more_subfields_xml(_get_unlinked_subfields_xml($unlinked_item_subfields));
328
    $item_object->more_subfields_xml(_get_unlinked_subfields_xml($unlinked_item_subfields));
316
    $item_object->store;
329
    $item_object->store({ skip_modzebra_update => $params->{skip_modzebra_update} });
317
330
318
    return $item_object->unblessed;
331
    return $item_object->unblessed;
319
}
332
}
(-)a/tools/batchMod.pl (-2 / +2 lines)
Lines 280-286 if ($op eq "action") { Link Here
280
                                            my $item = ModItemFromMarc(
280
                                            my $item = ModItemFromMarc(
281
                                                $localmarcitem,
281
                                                $localmarcitem,
282
                                                $itemdata->{biblionumber},
282
                                                $itemdata->{biblionumber},
283
                                                $itemnumber
283
                                                $itemnumber,
284
                                                { skip_modzebra_update => 1 }, # LostItem will deal with the reindex
284
                                            )
285
                                            )
285
                                          )
286
                                          )
286
                                        {
287
                                        {
287
- 

Return to bug 25265