Lines 361-371
sub ModBiblio {
Link Here
|
361 |
return 0; |
361 |
return 0; |
362 |
} |
362 |
} |
363 |
|
363 |
|
364 |
if ( C4::Context->preference("CataloguingLog") ) { |
|
|
365 |
my $biblio = Koha::Biblios->find($biblionumber); |
366 |
logaction( "CATALOGUING", "MODIFY", $biblionumber, "biblio BEFORE=>" . $biblio->metadata->record->as_formatted ); |
367 |
} |
368 |
|
369 |
if ( !$options->{disable_autolink} && C4::Context->preference('BiblioAddsAuthorities') ) { |
364 |
if ( !$options->{disable_autolink} && C4::Context->preference('BiblioAddsAuthorities') ) { |
370 |
BiblioAutoLink( $record, $frameworkcode ); |
365 |
BiblioAutoLink( $record, $frameworkcode ); |
371 |
} |
366 |
} |
Lines 417-443
sub ModBiblio {
Link Here
|
417 |
# update MARC subfield that stores biblioitems.cn_sort |
412 |
# update MARC subfield that stores biblioitems.cn_sort |
418 |
_koha_marc_update_biblioitem_cn_sort( $record, $oldbiblio, $frameworkcode ); |
413 |
_koha_marc_update_biblioitem_cn_sort( $record, $oldbiblio, $frameworkcode ); |
419 |
|
414 |
|
420 |
# update the MARC record (that now contains biblio and items) with the new record data |
415 |
my $schema = Koha::Database->schema; |
421 |
ModBiblioMarc( $record, $biblionumber, { skip_record_index => $skip_record_index } ); |
416 |
my $result = 0; |
|
|
417 |
$schema->txn_do(sub{ |
418 |
|
419 |
my $biblio = Koha::Biblios->find($biblionumber); |
420 |
my $orig_rec = $biblio->metadata->record; |
421 |
if( $orig_rec->field('005')->as_string eq $record->field('005')->as_string ){ |
422 |
|
423 |
if ( C4::Context->preference("CataloguingLog") ) { |
424 |
logaction( "CATALOGUING", "MODIFY", $biblionumber, "biblio BEFORE=>" . $orig_rec->as_formatted ); |
425 |
} |
422 |
|
426 |
|
423 |
# modify the other koha tables |
427 |
# update the MARC record (that now contains biblio and items) with the new record data |
424 |
_koha_modify_biblio( $dbh, $oldbiblio, $frameworkcode ); |
428 |
ModBiblioMarc( $record, $biblionumber, { skip_record_index => $skip_record_index } ); |
425 |
_koha_modify_biblioitem_nonmarc( $dbh, $oldbiblio ); |
|
|
426 |
|
429 |
|
427 |
_after_biblio_action_hooks({ action => 'modify', biblio_id => $biblionumber }); |
430 |
# modify the other koha tables |
|
|
431 |
_koha_modify_biblio( $dbh, $oldbiblio, $frameworkcode ); |
432 |
_koha_modify_biblioitem_nonmarc( $dbh, $oldbiblio ); |
428 |
|
433 |
|
429 |
# update OAI-PMH sets |
434 |
_after_biblio_action_hooks({ action => 'modify', biblio_id => $biblionumber }); |
430 |
if(C4::Context->preference("OAI-PMH:AutoUpdateSets")) { |
|
|
431 |
C4::OAI::Sets::UpdateOAISetsBiblio($biblionumber, $record); |
432 |
} |
433 |
|
435 |
|
434 |
Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue->new->enqueue( |
436 |
# update OAI-PMH sets |
435 |
{ |
437 |
if(C4::Context->preference("OAI-PMH:AutoUpdateSets")) { |
436 |
biblio_ids => [ $biblionumber ] |
438 |
C4::OAI::Sets::UpdateOAISetsBiblio($biblionumber, $record); |
|
|
439 |
} |
440 |
|
441 |
Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue->new->enqueue( |
442 |
{ |
443 |
biblio_ids => [ $biblionumber ] |
444 |
} |
445 |
) unless $options->{skip_holds_queue} or !C4::Context->preference('RealTimeHoldsQueue'); |
446 |
|
447 |
$result = 1; |
448 |
|
449 |
} else { |
450 |
$result = -1; |
437 |
} |
451 |
} |
438 |
) unless $options->{skip_holds_queue} or !C4::Context->preference('RealTimeHoldsQueue'); |
452 |
}); |
439 |
|
453 |
|
440 |
return 1; |
454 |
return $result; |
441 |
} |
455 |
} |
442 |
|
456 |
|
443 |
=head2 _strip_item_fields |
457 |
=head2 _strip_item_fields |