Bugzilla – Attachment 170493 Details for
Bug 37679
Dublin Core export option broken
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37679: Add DC subtypes to allow-list in opac-export.pl
Bug-37679-Add-DC-subtypes-to-allow-list-in-opac-ex.patch (text/plain), 2.15 KB, created by
Owen Leonard
on 2024-08-20 10:43:46 UTC
(
hide
)
Description:
Bug 37679: Add DC subtypes to allow-list in opac-export.pl
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2024-08-20 10:43:46 UTC
Size:
2.15 KB
patch
obsolete
>From c3a48516ef31a1cf6c125a11463c0d969a5b79d6 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 19 Aug 2024 17:12:23 -0300 >Subject: [PATCH] Bug 37679: Add DC subtypes to allow-list in opac-export.pl > >Bug 37370 added an allow-list of formats for exporting in the OPAC. But >it missed the fact there was a modal for choosing DublinCore subtypes >when Dublin Core is chosen in the first place. > >This patch fixes this. > >To test: >1. On a fresh KTD, make sure `OpacExportOptions` has all options enabled >2. Go to the OPAC and pick a record detail page >3. Choose Save record > Bibtex >=> SUCCESS: The save dialog for bibtext works >4. Repeat for DublinCore, choose any of the sub formats in the modal >=> FAIL: You get a 400 page >5. Go back to 2 >6. Apply this patch, and repeat 4 >=> SUCCESS: It works! >7. Without refreshing the page, disable DublinCore in the sysprefs >8. Choose any subformat and proceed >=> SUCCESS: You get a 400! This means the subformats are only considered >if DublinCore itself is enabled >9. Sign off :-D > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > opac/opac-export.pl | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > >diff --git a/opac/opac-export.pl b/opac/opac-export.pl >index d0e5bf1203..a39c804695 100755 >--- a/opac/opac-export.pl >+++ b/opac/opac-export.pl >@@ -33,7 +33,7 @@ use C4::Ris qw( marc2ris ); > use Koha::Biblios; > use Koha::RecordProcessor; > >-use List::MoreUtils qw(none); >+use List::MoreUtils qw(none any); > > my $query = CGI->new; > my $op=$query->param("op")||''; #op=export is currently the only use >@@ -42,7 +42,14 @@ my $biblionumber = $query->param("bib")||0; > $biblionumber = int($biblionumber); > my $error = q{}; > >+my @dc_subtypes = qw(rdfdc oaidc srwdc); > my @valid_formats = split( ',', C4::Context->preference('OpacExportOptions') // '' ); >+ >+if ( any { $_ eq 'dc' } @valid_formats ) { >+ # DC enabled, add @dc_subtypes to @valid_formats >+ @valid_formats = ( @valid_formats, @dc_subtypes ); >+} >+ > if ( !scalar @valid_formats || none { $format eq $_ } @valid_formats ) { > # bad request: either the feature is disabled, or requested a format the > # library hasn't made available >-- >2.39.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 37679
:
170480
|
170493
|
170568