Bug 23713 - Subscription add form broken for translations
Summary: Subscription add form broken for translations
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: master
Hardware: All All
: P5 - low critical (vote)
Assignee: Owen Leonard
QA Contact: Julian Maurice
URL:
Keywords:
: 23703 23973 24032 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-10-01 14:43 UTC by Katrin Fischer
Modified: 2019-12-03 12:01 UTC (History)
10 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
19.11.00,19.05.05


Attachments
Bug 23713: Subscription add form broken for translations (2.24 KB, patch)
2019-10-01 16:22 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 23713: Subscription add form broken for translations (2.24 KB, patch)
2019-10-02 09:24 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 23713: (follow-up) Add missing semicolon (1.75 KB, patch)
2019-10-02 09:24 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 23713: Subscription add form broken for translations (2.46 KB, patch)
2019-10-03 09:19 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 23713: (follow-up) Add missing semicolon (1.80 KB, patch)
2019-10-03 09:19 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 23713: Subscription add form broken for translations (2.29 KB, patch)
2019-10-03 09:21 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 23713: (follow-up) Add missing semicolon (1.80 KB, patch)
2019-10-03 09:21 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2019-10-01 14:43:07 UTC
It's not possible to add a new subscription using translated templates.

What I see is:

English template:
var mana_enabled = [% IF (Koha.Preference('Mana') == 1 && mana_url) %]1[% ELSE %]0[% END %];

de-DE template:
var mana_enabled = [% IF (Koha.Preference('Mana') == 1 && mana_url) %]1[% ELSE %][% END %];

We are also missing a semicolon in one of the lines, but this doesn't seem to effect the page functionality:

     var MSG_PATTERN_IRREG = _("Warning! Present pattern has planned irregularities. Click on 'Test prediction pattern' to check if it's still valid")


Thx to Michael Hoffert and Alexander Arlt from koha-de for reporting it initially and figuring out the root of the issue!
Comment 1 Katrin Fischer 2019-10-01 14:49:25 UTC
To give a bit more info, the Javascript we get from the wrong TT is:

var mana_enabled = ;

So this implodes. It should be:

var mana_enabled = 0;
Comment 2 Owen Leonard 2019-10-01 16:22:58 UTC
Created attachment 93385 [details] [review]
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.
Comment 3 Katrin Fischer 2019-10-02 06:27:43 UTC
Thx, Owen! Was going to tackle it this morning in a similar fashion!
Comment 4 Katrin Fischer 2019-10-02 07:39:42 UTC
Great test plan!
Comment 5 Katrin Fischer 2019-10-02 09:24:30 UTC
Created attachment 93399 [details] [review]
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.
Comment 6 Katrin Fischer 2019-10-02 09:24:34 UTC
Created attachment 93400 [details] [review]
Bug 23713: (follow-up) Add missing semicolon

Adds a missing semicolon to one of the lines with translated
messages.
Comment 7 Julian Maurice 2019-10-03 09:19:33 UTC
Created attachment 93536 [details] [review]
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 <katrin.fischer@bsz-bw.de>
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 <julian.maurice@biblibre.com>
Comment 8 Julian Maurice 2019-10-03 09:19:54 UTC
Created attachment 93537 [details] [review]
Bug 23713: (follow-up) Add missing semicolon

Adds a missing semicolon to one of the lines with translated
messages.

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Comment 9 Nick Clemens 2019-10-03 09:21:33 UTC
Created attachment 93538 [details] [review]
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.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 10 Nick Clemens 2019-10-03 09:21:36 UTC
Created attachment 93539 [details] [review]
Bug 23713: (follow-up) Add missing semicolon

Adds a missing semicolon to one of the lines with translated
messages.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 11 Martin Renvoize 2019-10-03 09:32:05 UTC
Nice work!

Pushed to master for 19.11.00
Comment 12 Katrin Fischer 2019-10-03 09:37:22 UTC
Thx all!
Comment 13 Owen Leonard 2019-10-04 15:07:55 UTC
*** Bug 23703 has been marked as a duplicate of this bug. ***
Comment 14 Katrin Fischer 2019-11-05 18:10:01 UTC
Hi all, this is a major bug confirmed in 18.11 - can this please be backported?
Comment 15 Katrin Fischer 2019-11-05 18:10:50 UTC
*** Bug 23973 has been marked as a duplicate of this bug. ***
Comment 16 Magnus Enger 2019-11-06 07:29:59 UTC
(In reply to Katrin Fischer from comment #14)
> Hi all, this is a major bug confirmed in 18.11 - can this please be
> backported?

+1 for backporting! :-)
Comment 17 Jonathan Druart 2019-11-13 12:38:46 UTC
*** Bug 24032 has been marked as a duplicate of this bug. ***
Comment 18 Jonathan Druart 2019-11-13 12:40:48 UTC
This is weird, and this patch is just cheating. Any ideas how we could avoid that?

Upping severity, backport this one urgently!
Comment 19 Katrin Fischer 2019-11-13 13:24:40 UTC
(In reply to Katrin Fischer from comment #14)
> Hi all, this is a major bug confirmed in 18.11 - can this please be
> backported?

That should read 19.05 - as 18.11 has no Mana, this only needs to go in 19.05
Comment 20 Fridolin SOMERS 2019-11-15 08:32:37 UTC
Pushed to 19.05.x for 19.05.05
Comment 21 Katrin Fischer 2019-12-02 13:36:40 UTC
Can this PLEASE be finally backported to 18.11 too? This bug means the serials module is unsable for everyone not speaking/using English.
Comment 22 Katrin Fischer 2019-12-03 12:01:30 UTC
(In reply to Katrin Fischer from comment #21)
> Can this PLEASE be finally backported to 18.11 too? This bug means the
> serials module is unsable for everyone not speaking/using English.

I am sorry, but is caused by changes for Mana - but there is no Mana in 18.11.