Bug 41084: Allow utf8 export format when EnableZotero is enabled
When the EnableZotero system preference is enabled, allow the utf8 format in opac-export.pl regardless of the OpacExportOptions settings. This enables Zotero integration by ensuring the required UTF-8 encoded MARC format is always available when the feature is enabled. To test: 1. Install Zotero (https://www.zotero.org) 2. Install the browser extension (I did in in Chrome, not sure it exists for FF) 3. Perform a search in your koha instance. e.g. http://kohadev.localhost/cgi-bin/koha/opac-search.pl?idx=&q=agrovoc&weight_search=1 4. Open the Zotero extension => SUCCESS: It lists the search results for saving them 5. Choose one and save => FAIL: It says there was an error saving 6. Apply this patches 7. Run: $ ktd --shell k$ updatedatabase 8. Make sure EnableZotero is enabled 9. Repeat 3-5 => SUCCESS: All good this time 10. Sign off :-D Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
parent
5b3baf4170
commit
5d8af22026
|
|
@ -50,6 +50,11 @@ if ( any { $_ eq 'dc' } @valid_formats ) {
|
|||
@valid_formats = ( @valid_formats, @dc_subtypes );
|
||||
}
|
||||
|
||||
# Allow utf8 format if EnableZotero is enabled, regardless of OpacExportOptions
|
||||
if ( C4::Context->preference('EnableZotero') && $format eq 'utf8' ) {
|
||||
push @valid_formats, 'utf8' unless any { $_ eq 'utf8' } @valid_formats;
|
||||
}
|
||||
|
||||
if ( !scalar @valid_formats || none { $format eq $_ } @valid_formats ) {
|
||||
|
||||
# bad request: either the feature is disabled, or requested a format the
|
||||
|
|
|
|||
Loading…
Reference in New Issue