From b2521fdf1b67e3aa87e81e62b102bbf719c3d913 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 23 Jul 2021 14:16:06 +0000 Subject: [PATCH] Bug 28750: (bug 17600 follow-up) Use full routine names in svc/new_bib svc/bib To test: 1 - Attempt to save a record in the advanced cataloging editor 2 - It fails 3 - Apply patch 4 - It succeeds Signed-off-by: David Nind --- svc/bib | 14 +++++++------- svc/new_bib | 12 ++++++------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/svc/bib b/svc/bib index 43fc6f6857..5d412dc7de 100755 --- a/svc/bib +++ b/svc/bib @@ -65,7 +65,7 @@ exit 0; sub fetch_bib { my $query = shift; my $biblionumber = shift; - my $record = GetMarcBiblio({ + my $record = C4::Biblio::GetMarcBiblio({ biblionumber => $biblionumber, embed_items => scalar $query->param('items') }); if (defined $record) { @@ -79,7 +79,7 @@ sub fetch_bib { sub update_bib { my $query = shift; my $biblionumber = shift; - my $old_record = GetMarcBiblio({ biblionumber => $biblionumber }); + my $old_record = C4::Biblio::GetMarcBiblio({ biblionumber => $biblionumber }); my $frameworkcode = $query->url_param('frameworkcode') // GetFrameworkCode($biblionumber); unless (defined $old_record) { print $query->header(-type => 'text/xml', -status => '404 Not Found'); @@ -98,7 +98,7 @@ sub update_bib { } else { my $fullrecord = $record->clone(); my ( $itemtag, $itemsubfield ) = - GetMarcFromKohaField( "items.itemnumber" ); + C4::Biblio::GetMarcFromKohaField( "items.itemnumber" ); # delete any item tags foreach my $field ( $record->field($itemtag) ) { @@ -109,13 +109,13 @@ sub update_bib { foreach my $field ( $fullrecord->field($itemtag) ) { my $one_item_record = $record->clone(); $one_item_record->add_fields($field); - ModItemFromMarc( $one_item_record, $biblionumber, + C4::Items::ModItemFromMarc( $one_item_record, $biblionumber, $field->subfield($itemsubfield) ); } } - ModBiblio( $record, $biblionumber, $frameworkcode ); - my $new_record = GetMarcBiblio({ + C4::Biblio::ModBiblio( $record, $biblionumber, $frameworkcode ); + my $new_record = C4::Biblio::GetMarcBiblio({ biblionumber => $biblionumber, embed_items => scalar $query->url_param('items') }); @@ -133,7 +133,7 @@ sub update_bib { sub delete_bib { my $query = shift; my $biblionumber = shift; - my $error = DelBiblio($biblionumber); + my $error = C4::Biblio::DelBiblio($biblionumber); if (defined $error) { print $query->header(-type => 'text/xml', -status => '400 Bad request'); diff --git a/svc/new_bib b/svc/new_bib index 0aa04fc6cf..57a5988c4a 100755 --- a/svc/new_bib +++ b/svc/new_bib @@ -63,28 +63,28 @@ sub add_bib { # fix character set if ($record->encoding() eq 'MARC-8') { my ($guessed_charset, $charset_errors); - ($record, $guessed_charset, $charset_errors) = MarcToUTF8Record($record, $marcflavour); + ($record, $guessed_charset, $charset_errors) = C4::Charset::MarcToUTF8Record($record, $marcflavour); } my $fullrecord = $record->clone(); # delete any item tags my ( $itemtag, $itemsubfield ) = - GetMarcFromKohaField( "items.itemnumber" ); + C4::Biblio::GetMarcFromKohaField( "items.itemnumber" ); foreach my $field ( $record->field($itemtag) ) { $record->delete_field($field); } - my ( $biblionumber, $biblioitemnumber ) = AddBiblio( $record, $frameworkcode ); - my $new_record = GetMarcBiblio({ biblionumber => $biblionumber }); + my ( $biblionumber, $biblioitemnumber ) = C4::Biblio::AddBiblio( $record, $frameworkcode ); + my $new_record = C4::Biblio::GetMarcBiblio({ biblionumber => $biblionumber }); if ( $query->url_param('items') ) { foreach my $field ( $fullrecord->field($itemtag) ) { my $one_item_record = $new_record->clone(); $one_item_record->add_fields($field); - AddItemFromMarc( $one_item_record, $biblionumber ); + C4::Items::AddItemFromMarc( $one_item_record, $biblionumber ); } } - $new_record = GetMarcBiblio({ + $new_record = C4::Biblio::GetMarcBiblio({ biblionumber => $biblionumber, embed_items => scalar $query->url_param('items') }); $result->{'status'} = "ok"; -- 2.20.1