Bug 37679 - Dublin Core export option broken
Summary: Dublin Core export option broken
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal
Assignee: Tomás Cohen Arazi (tcohen)
QA Contact: Paul Derscheid
URL:
Keywords: regression, RM_priority
Depends on: 37370
Blocks:
  Show dependency treegraph
 
Reported: 2024-08-19 20:11 UTC by Tomás Cohen Arazi (tcohen)
Modified: 2024-08-22 14:47 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.11.00
Circulation function:


Attachments
Bug 37679: Add DC subtypes to allow-list in opac-export.pl (2.10 KB, patch)
2024-08-19 20:20 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 37679: Add DC subtypes to allow-list in opac-export.pl (2.15 KB, patch)
2024-08-20 10:43 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 37679: Add DC subtypes to allow-list in opac-export.pl (2.20 KB, patch)
2024-08-21 14:59 UTC, Paul Derscheid
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi (tcohen) 2024-08-19 20:11:22 UTC
Bug 37370 added a check on valid formats defined on the `OpacExportOptions` syspref, but it turns out the `opac-export.pl` script receives another strings (subtypes) when one of the DublinCore options is selected. This was not considered on the bug and needs to be fixed.
Comment 1 Tomás Cohen Arazi (tcohen) 2024-08-19 20:20:49 UTC
Created attachment 170480 [details] [review]
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
Comment 2 Owen Leonard 2024-08-20 10:43:46 UTC
Created attachment 170493 [details] [review]
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>
Comment 3 Paul Derscheid 2024-08-21 14:59:10 UTC
Created attachment 170568 [details] [review]
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>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Comment 4 Katrin Fischer 2024-08-22 14:47:43 UTC
Pushed for 24.11!

Well done everyone, thank you!