Lines 351-357
Returns 1 on success 0 on failure
Link Here
|
351 |
|
351 |
|
352 |
sub ModBiblio { |
352 |
sub ModBiblio { |
353 |
my ( $record, $biblionumber, $frameworkcode, $options ) = @_; |
353 |
my ( $record, $biblionumber, $frameworkcode, $options ) = @_; |
|
|
354 |
|
354 |
$options //= {}; |
355 |
$options //= {}; |
|
|
356 |
my $skip_record_index = $options->{skip_record_index} || 0; |
355 |
|
357 |
|
356 |
if (!$record) { |
358 |
if (!$record) { |
357 |
carp 'No record passed to ModBiblio'; |
359 |
carp 'No record passed to ModBiblio'; |
Lines 415-421
sub ModBiblio {
Link Here
|
415 |
_koha_marc_update_biblioitem_cn_sort( $record, $oldbiblio, $frameworkcode ); |
417 |
_koha_marc_update_biblioitem_cn_sort( $record, $oldbiblio, $frameworkcode ); |
416 |
|
418 |
|
417 |
# update the MARC record (that now contains biblio and items) with the new record data |
419 |
# update the MARC record (that now contains biblio and items) with the new record data |
418 |
ModBiblioMarc( $record, $biblionumber ); |
420 |
ModBiblioMarc( $record, $biblionumber, { skip_record_index => $skip_record_index } ); |
419 |
|
421 |
|
420 |
# modify the other koha tables |
422 |
# modify the other koha tables |
421 |
_koha_modify_biblio( $dbh, $oldbiblio, $frameworkcode ); |
423 |
_koha_modify_biblio( $dbh, $oldbiblio, $frameworkcode ); |
Lines 2852-2863
Function exported, but should NOT be used, unless you really know what you're do
Link Here
|
2852 |
sub ModBiblioMarc { |
2854 |
sub ModBiblioMarc { |
2853 |
# pass the MARC::Record to this function, and it will create the records in |
2855 |
# pass the MARC::Record to this function, and it will create the records in |
2854 |
# the marcxml field |
2856 |
# the marcxml field |
2855 |
my ( $record, $biblionumber ) = @_; |
2857 |
my ( $record, $biblionumber, $params ) = @_; |
2856 |
if ( !$record ) { |
2858 |
if ( !$record ) { |
2857 |
carp 'ModBiblioMarc passed an undefined record'; |
2859 |
carp 'ModBiblioMarc passed an undefined record'; |
2858 |
return; |
2860 |
return; |
2859 |
} |
2861 |
} |
2860 |
|
2862 |
|
|
|
2863 |
my $skip_record_index = $params->{skip_record_index} || 0; |
2864 |
|
2861 |
# Clone record as it gets modified |
2865 |
# Clone record as it gets modified |
2862 |
$record = $record->clone(); |
2866 |
$record = $record->clone(); |
2863 |
my $dbh = C4::Context->dbh; |
2867 |
my $dbh = C4::Context->dbh; |
Lines 2917-2924
sub ModBiblioMarc {
Link Here
|
2917 |
$m_rs->metadata( $record->as_xml_record($encoding) ); |
2921 |
$m_rs->metadata( $record->as_xml_record($encoding) ); |
2918 |
$m_rs->store; |
2922 |
$m_rs->store; |
2919 |
|
2923 |
|
2920 |
my $indexer = Koha::SearchEngine::Indexer->new({ index => $Koha::SearchEngine::BIBLIOS_INDEX }); |
2924 |
unless ( $skip_record_index ) { |
2921 |
$indexer->index_records( $biblionumber, "specialUpdate", "biblioserver" ); |
2925 |
my $indexer = Koha::SearchEngine::Indexer->new({ index => $Koha::SearchEngine::BIBLIOS_INDEX }); |
|
|
2926 |
$indexer->index_records( $biblionumber, "specialUpdate", "biblioserver" ); |
2927 |
} |
2922 |
|
2928 |
|
2923 |
return $biblionumber; |
2929 |
return $biblionumber; |
2924 |
} |
2930 |
} |