|
Lines 310-316
sub AddBiblio {
Link Here
|
| 310 |
); |
310 |
); |
| 311 |
|
311 |
|
| 312 |
_after_biblio_action_hooks( { action => 'create', biblio_id => $biblionumber } ); |
312 |
_after_biblio_action_hooks( { action => 'create', biblio_id => $biblionumber } ); |
| 313 |
logaction( "CATALOGUING", "ADD", $biblionumber, "biblio" ) if C4::Context->preference("CataloguingLog"); |
313 |
if ( C4::Context->preference("CataloguingLog") ) { |
|
|
314 |
logaction( "CATALOGUING", "ADD", $biblionumber, "biblio", undef, Koha::Biblios->find($biblionumber) ); |
| 315 |
} |
| 314 |
|
316 |
|
| 315 |
# We index now, after the transaction is committed |
317 |
# We index now, after the transaction is committed |
| 316 |
unless ($skip_record_index) { |
318 |
unless ($skip_record_index) { |
|
Lines 395-412
sub ModBiblio {
Link Here
|
| 395 |
return 0; |
397 |
return 0; |
| 396 |
} |
398 |
} |
| 397 |
|
399 |
|
|
|
400 |
my $original; |
| 398 |
if ( C4::Context->preference("CataloguingLog") ) { |
401 |
if ( C4::Context->preference("CataloguingLog") ) { |
| 399 |
my $biblio = Koha::Biblios->find($biblionumber); |
402 |
$original = Koha::Biblios->find($biblionumber)->unblessed; |
| 400 |
my $record; |
|
|
| 401 |
my $decoding_error = ""; |
| 402 |
eval { $record = $biblio->metadata->record }; |
| 403 |
if ($@) { |
| 404 |
my $exception = $@; |
| 405 |
$exception->rethrow unless ( $exception->isa('Koha::Exceptions::Metadata::Invalid') ); |
| 406 |
$decoding_error = "There was an error with this bibliographic record: " . $exception; |
| 407 |
$record = $biblio->metadata->record_strip_nonxml; |
| 408 |
} |
| 409 |
logaction( "CATALOGUING", "MODIFY", $biblionumber, "biblio $decoding_error BEFORE=>" . $record->as_formatted ); |
| 410 |
} |
403 |
} |
| 411 |
|
404 |
|
| 412 |
if ( !$options->{disable_autolink} && C4::Context->preference('AutoLinkBiblios') ) { |
405 |
if ( !$options->{disable_autolink} && C4::Context->preference('AutoLinkBiblios') ) { |
|
Lines 469-474
sub ModBiblio {
Link Here
|
| 469 |
|
462 |
|
| 470 |
_after_biblio_action_hooks( { action => 'modify', biblio_id => $biblionumber } ); |
463 |
_after_biblio_action_hooks( { action => 'modify', biblio_id => $biblionumber } ); |
| 471 |
|
464 |
|
|
|
465 |
if ( C4::Context->preference("CataloguingLog") ) { |
| 466 |
logaction( "CATALOGUING", "MODIFY", $biblionumber, Koha::Biblios->find($biblionumber), undef, $original ); |
| 467 |
} |
| 468 |
|
| 472 |
# update OAI-PMH sets |
469 |
# update OAI-PMH sets |
| 473 |
if ( C4::Context->preference("OAI-PMH:AutoUpdateSets") ) { |
470 |
if ( C4::Context->preference("OAI-PMH:AutoUpdateSets") ) { |
| 474 |
C4::OAI::Sets::UpdateOAISetsBiblio( $biblionumber, $record ); |
471 |
C4::OAI::Sets::UpdateOAISetsBiblio( $biblionumber, $record ); |
|
Lines 588-594
sub DelBiblio {
Link Here
|
| 588 |
|
585 |
|
| 589 |
_after_biblio_action_hooks( { action => 'delete', biblio_id => $biblionumber } ); |
586 |
_after_biblio_action_hooks( { action => 'delete', biblio_id => $biblionumber } ); |
| 590 |
|
587 |
|
| 591 |
logaction( "CATALOGUING", "DELETE", $biblionumber, "biblio" ) if C4::Context->preference("CataloguingLog"); |
588 |
logaction( "CATALOGUING", "DELETE", $biblionumber, "biblio", undef, $biblio ) |
|
|
589 |
if C4::Context->preference("CataloguingLog"); |
| 592 |
|
590 |
|
| 593 |
Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue->new->enqueue( { biblio_ids => [$biblionumber] } ) |
591 |
Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue->new->enqueue( { biblio_ids => [$biblionumber] } ) |
| 594 |
unless $params->{skip_holds_queue} |
592 |
unless $params->{skip_holds_queue} |