Bug 20097: Use same regex in marc2dcxml and opac-export
This regex allows: dc, oaidc, srwdc, and rdfdc. Test plan: [1] Check https://[yourserver]/cgi-bin/koha/opac-export.pl?bib=[some_biblionumber]&op=export&format=dc [2] Check https://[yourserver]/cgi-bin/koha/opac-export.pl?bib=[some_biblionumber]&op=export&format=oaidc [3] Check https://[yourserver]/cgi-bin/koha/opac-export.pl?bib=[some_biblionumber]&op=export&format=nodc. This one should trigger a not-supported message. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
6d479dc5e5
commit
f24e48577f
|
|
@ -294,7 +294,7 @@ sub marc2dcxml {
|
|||
};
|
||||
} elsif ( $record =~ /^MARC::Record/ ) { # if OK makes xslt transformation
|
||||
my $xslt_engine = Koha::XSLT_Handler->new;
|
||||
if ( $format =~ /oaidc|srwdc|rdfdc/ ) {
|
||||
if ( $format =~ /^(dc|oaidc|srwdc|rdfdc)$/i ) {
|
||||
$output = $xslt_engine->transform( $marcxml, $xsl );
|
||||
} else {
|
||||
croak "The format argument ($format) not accepted.\n" .
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ elsif ($format =~ /bibtex/) {
|
|||
$marc = marc2bibtex($marc,$biblionumber);
|
||||
$format = 'bibtex';
|
||||
}
|
||||
elsif ($format =~ /dc$/) {
|
||||
elsif ($format =~ /^(dc|oaidc|srwdc|rdfdc)$/i ) {
|
||||
# TODO: Dublin Core leaks fields marked hidden by framework.
|
||||
$marc = marc2dcxml($marc, undef, $biblionumber, $format);
|
||||
$format = "dublin-core.xml";
|
||||
|
|
|
|||
Loading…
Reference in New Issue