Lines 70-83
sub fetch_bib {
Link Here
|
70 |
my $record; |
70 |
my $record; |
71 |
my $exception; |
71 |
my $exception; |
72 |
my $invalid_metadata = 0; |
72 |
my $invalid_metadata = 0; |
73 |
eval { $record = $biblio->metadata->record( { embed_items => scalar $query->param('items') } ) }; |
73 |
if ( defined $biblio ) { |
74 |
if ($@) { |
74 |
eval { $record = $biblio->metadata->record( { embed_items => scalar $query->param('items') } ) }; |
75 |
$exception = $@; |
75 |
if ($@) { |
76 |
$exception->rethrow unless ( $exception->isa('Koha::Exceptions::Metadata::Invalid') ); |
76 |
$exception = $@; |
77 |
$record = $biblio->metadata->record_strip_nonxml( { embed_items => scalar $query->param('items') } ); |
77 |
$exception->rethrow unless ( $exception->isa('Koha::Exceptions::Metadata::Invalid') ); |
78 |
$invalid_metadata = 1; |
78 |
$record = $biblio->metadata->record_strip_nonxml( { embed_items => scalar $query->param('items') } ); |
79 |
} |
79 |
$invalid_metadata = 1; |
80 |
if ( defined $record ) { |
80 |
} |
81 |
print $query->header( -type => 'text/xml', -charset => 'utf-8', -invalid_metadata => $invalid_metadata ); |
81 |
print $query->header( -type => 'text/xml', -charset => 'utf-8', -invalid_metadata => $invalid_metadata ); |
82 |
print $record->as_xml_record(); |
82 |
print $record->as_xml_record(); |
83 |
} else { |
83 |
} else { |
84 |
- |
|
|