Bug 20298

Summary: Notices template uses same html id for each language
Product: Koha Reporter: paxed <pasi.kallinen>
Component: NoticesAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: jonathan.druart, josef.moravec, martin.renvoize
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 20298: Fix SMS characters counter when TranslateNotices is set
Bug 20298: Fix SMS characters counter when TranslateNotices is set
Bug 20298: Fix SMS characters counter when TranslateNotices is set
Bug 20298: (follow-up) fix labels' for attributes

Description paxed 2018-02-26 13:02:19 UTC
If you have multiple languages installed, the notices and slips page uses the same HTML id multiple times, once for each language. This prevents eg. the SMS character count javascript from working, because each of the textareas has the same id.
Comment 1 Jonathan Druart 2018-02-28 17:28:24 UTC
Created attachment 72293 [details] [review]
Bug 20298: Fix SMS characters counter when TranslateNotices is set

If you have multiple languages installed, the notices and slips page
uses the same HTML id multiple times, once for each language. This
prevents eg. the SMS character count javascript from working, because
each of the textareas has the same id.

Test plan:
Test the sms characters counter, with and without TranslateNotices
Make sure other features on this page still work correctly

QA: Make sure this change of id did not break something else.
Comment 2 paxed 2018-03-01 06:43:01 UTC
Also:
tools/letter.pl:        my $is_html = $input->param("is_html_$mtt");

And I'd guess all of the id attributes in the template within the "FOREACH lang IN letters.keys" -loop need to be verified, not just the sms ones ... :/
Comment 3 paxed 2018-03-01 06:45:01 UTC
(In reply to paxed from comment #2)
> Also:
> tools/letter.pl:        my $is_html = $input->param("is_html_$mtt");
> 

Derp, nevermind, that's the name, not the id.
Comment 4 Brendan Gallagher 2018-03-16 08:45:55 UTC
Created attachment 72993 [details] [review]
Bug 20298: Fix SMS characters counter when TranslateNotices is set

If you have multiple languages installed, the notices and slips page
uses the same HTML id multiple times, once for each language. This
prevents eg. the SMS character count javascript from working, because
each of the textareas has the same id.

Test plan:
Test the sms characters counter, with and without TranslateNotices
Make sure other features on this page still work correctly

QA: Make sure this change of id did not break something else.

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Comment 5 Katrin Fischer 2018-03-25 10:02:26 UTC
Created attachment 73238 [details] [review]
Bug 20298: Fix SMS characters counter when TranslateNotices is set

If you have multiple languages installed, the notices and slips page
uses the same HTML id multiple times, once for each language. This
prevents eg. the SMS character count javascript from working, because
each of the textareas has the same id.

Test plan:
Test the sms characters counter, with and without TranslateNotices
Make sure other features on this page still work correctly

QA: Make sure this change of id did not break something else.

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 6 Jonathan Druart 2018-03-26 20:38:14 UTC
Pushed to master for 18.05, thanks to everybody involved!
Comment 7 Jonathan Druart 2018-04-06 17:09:19 UTC
Created attachment 73792 [details] [review]
Bug 20298: (follow-up) fix labels' for attributes
Comment 8 Jonathan Druart 2018-04-06 17:53:32 UTC
(In reply to Jonathan Druart from comment #7)
> Created attachment 73792 [details] [review] [review]
> Bug 20298: (follow-up) fix labels' for attributes

Pushed to master for 18.05