[Koha-patches] [PATCH] bug 2659: fix crash in OAI-PMH interface
Galen Charlton
galen.charlton at liblime.com
Mon Oct 6 03:40:24 CEST 2008
When retrieving a record via the OAI-PMH interface, if one of the fields used
to prepare the DC metadata is not defined in the MARC framework (e.g.,
biblioitems.publicationyear in the default MARC21 framework), an OAI GetRecord
can fail with the following error:
> Can't call method "as_string" on an undefined value at
> /usr/share/koha/opac/cgi-bin/opac/oai.pl line 59.
---
opac/oai.pl | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/opac/oai.pl b/opac/oai.pl
index 44b7367..532c3b8 100755
--- a/opac/oai.pl
+++ b/opac/oai.pl
@@ -56,6 +56,7 @@ my @result = ();
foreach my $kohafield ( @_ ) {
my ( $field, $subfield ) = ::GetMarcFromKohaField( $kohafield, '' );
+ next unless defined $field; # $kohafield not defined in framework
push( @result, $field < 10 ? $marc->field( $field )->as_string() : $marc->subfield( $field, $subfield ) );
}
# @result>1 ? \@result : $result[0];
--
1.5.5.GIT
More information about the Koha-patches
mailing list