From 27972576dd2d4afc5a6d42068c5a10e286114367 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 1 Oct 2019 15:55:19 +0000 Subject: [PATCH] Bug 23713: Subscription add form broken for translations This patch makes a change to the subscription entry template as a workaround to a translation bug which is causing JavaScript errors when using translated templates. To test, apply the patch and update and install the de-DE template: > cd misc/translator > perl translate update de-DE > perl translate install de-DE - Go to Administration -> System preferences and enable the "Deutsch (de-DE)" language under I18N/L10N preferences -> language. - Switch to the "Deutsch" translation. - Go to Zeitschriften (Serials) -> Neues Abonnement (New subscription) and open the browser console. There should be no errors. - Links which trigger JavaScript events should work correctly: "Lieferant suchen," "Nach Datensatz suchen," etc. Reported-by: Katrin Fischer Thanks-to: Michael Hoffert and Alexander Arlt from koha-de for reporting it initially and figuring out the root of the issue Signed-off-by: Julian Maurice --- .../prog/en/modules/serials/subscription-add.tt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt index 9aa7248c7a..43eb7b3f41 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt @@ -526,7 +526,11 @@ fieldset.rows table { clear: none; margin: 0; } [% FOREACH field IN dont_export_field_loop %] tags.push("[% field.fieldid | html %]"); [% END %] - var mana_enabled = [% IF (Koha.Preference('Mana') == 1 && mana_url) %]1[% ELSE %]0[% END %]; + [%- IF (Koha.Preference('Mana') == 1 && mana_url) -%] + var mana_enabled = 1; + [%- ELSE -%] + var mana_enabled = 0; + [%- END -%] var MSG_LINK_TO_VENDOR = _("If you wish to claim late or missing issues you must link this subscription to a vendor. Click OK to ignore or Cancel to return and enter a vendor"); var MSG_LINK_BIBLIO = _("You must choose or create a bibliographic record"); var MSG_REQUIRED_SUB_LENGTH = _("You must choose a subscription length or an end date."); -- 2.20.1