Bugzilla – Attachment 190779 Details for
Bug 41084
Zotero connector broken by bug 37370
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41084: Allow utf8 export format when EnableZotero is enabled
eea445a.patch (text/plain), 1.82 KB, created by
Tomás Cohen Arazi (tcohen)
on 2025-12-30 13:56:44 UTC
(
hide
)
Description:
Bug 41084: Allow utf8 export format when EnableZotero is enabled
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2025-12-30 13:56:44 UTC
Size:
1.82 KB
patch
obsolete
>From eea445aabaa65d61119979bd9b28082972d49835 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Tom=C3=A1s=20Cohen=20Arazi?= <tomascohen@theke.io> >Date: Tue, 30 Dec 2025 10:09:12 -0300 >Subject: [PATCH] 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 >--- > opac/opac-export.pl | 5 +++++ > 1 file changed, 5 insertions(+) > >diff --git a/opac/opac-export.pl b/opac/opac-export.pl >index e8ef025b5e..7d1d509482 100755 >--- a/opac/opac-export.pl >+++ b/opac/opac-export.pl >@@ -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 >-- >2.50.1 (Apple Git-155) >
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 41084
:
190775
|
190776
|
190777
|
190778
| 190779