Lines 64-77
if ($query->request_method eq "GET") {
Link Here
|
64 |
exit 0; |
64 |
exit 0; |
65 |
|
65 |
|
66 |
sub fetch_bib { |
66 |
sub fetch_bib { |
67 |
my $query = shift; |
67 |
my ( $query, $biblionumber ) = @_; |
68 |
my $biblionumber = shift; |
68 |
my $biblio = Koha::Biblios->find($biblionumber); |
69 |
my $biblio = Koha::Biblios->find( $biblionumber ); |
|
|
70 |
my $record; |
69 |
my $record; |
71 |
my $exception; |
70 |
my $exception; |
72 |
my $invalid_metadata = 0; |
71 |
my $invalid_metadata = 0; |
73 |
if ( defined $biblio ) { |
72 |
if ( defined $biblio ) { |
74 |
eval { $record = $biblio->metadata->record( { embed_items => scalar $query->param('items') } ) }; |
73 |
eval { $record = $biblio->metadata_record( { embed_items => scalar $query->param('items') } ) }; |
75 |
if ($@) { |
74 |
if ($@) { |
76 |
$exception = $@; |
75 |
$exception = $@; |
77 |
$exception->rethrow unless ( $exception->isa('Koha::Exceptions::Metadata::Invalid') ); |
76 |
$exception->rethrow unless ( $exception->isa('Koha::Exceptions::Metadata::Invalid') ); |
Lines 126-132
sub update_bib {
Link Here
|
126 |
|
125 |
|
127 |
C4::Biblio::ModBiblio( $record, $biblionumber, $frameworkcode ); |
126 |
C4::Biblio::ModBiblio( $record, $biblionumber, $frameworkcode ); |
128 |
my $biblio = Koha::Biblios->find( $biblionumber ); |
127 |
my $biblio = Koha::Biblios->find( $biblionumber ); |
129 |
my $new_record = $biblio->metadata->record({ embed_items => scalar $query->url_param('items') }); |
128 |
my $new_record = $biblio->metadata_record( { embed_items => scalar $query->url_param('items') } ); |
130 |
|
129 |
|
131 |
$result->{'status'} = "ok"; |
130 |
$result->{'status'} = "ok"; |
132 |
$result->{'biblionumber'} = $biblionumber; |
131 |
$result->{'biblionumber'} = $biblionumber; |