Bug 23762

Summary: Editing is_html status of email template fails under multi-languages
Product: Koha Reporter: Bin Wen <bin.wen>
Component: NoticesAssignee: Bin Wen <bin.wen>
Status: CLOSED FIXED QA Contact: Martin Renvoize <martin.renvoize>
Severity: normal    
Priority: P5 - low CC: bin.wen, katrin.fischer, 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:
19.11.00
Attachments: Bug 23762 - Editing is_html status of email template fails under multi-languages
Bug 23762: Editing is_html status of email template fails under multi-languages
Bug 23762: Editing is_html status of email template fails under multi-languages

Description Bin Wen 2019-10-07 12:54:12 UTC
letter.tt did not pass the parameter 'lang' of 'is_html' to letter.pl, resulting in the failure to save the 'is_html' value of the corresponding language.
Comment 1 Bin Wen 2019-10-07 13:03:43 UTC
Created attachment 93820 [details] [review]
Bug 23762 - Editing is_html status of email template fails under multi-languages

To test:
1.Enable multi-languages
2.Set the preference 'TranslateNotices' on  'Allow'
3.Go to: tools==>Notices & slips==>Edit (one notice)
4.Click on the "Email" in the "Default" tab, change the checkbox status of 'HTML Messages'.
5.Save
6.Reopen the notice, nothing changed.
7.Apply the patch
8.Repeat the steps 4 and 5
9.Success.
Comment 2 Katrin Fischer 2019-10-09 05:29:39 UTC
Hi Bin, I tested this according to your test plan, but the HTML checkbox saves correctly for me on master. Can you please check your test plan again?

What I did:
- Edit MEMBERSHIP_EXPIRY
- Pick default tab
- Check checkbox for HTML
- Save
- Reopen 
- Checkbox was saved (patch wasn't applied)
Comment 3 Katrin Fischer 2019-10-09 05:30:41 UTC
Actually, it should be: Don't use default, but any other. I can see the issue when picking German.
Comment 4 Katrin Fischer 2019-10-09 05:35:04 UTC
(In reply to Katrin Fischer from comment #3)
> Actually, it should be: Don't use default, but any other. I can see the
> issue when picking German.

Actually no, this happens with and without the patch if no subject and text is entered. I am sorry, I can't replicate the problem :(
Comment 5 Katrin Fischer 2019-10-09 05:36:26 UTC
Ok... it cannot be unchecked it seems.
Comment 6 Katrin Fischer 2019-10-09 05:38:10 UTC
Created attachment 93906 [details] [review]
Bug 23762: Editing is_html status of email template fails under multi-languages

To test:
1.Enable multi-languages
2.Set the preference 'TranslateNotices' on  'Allow'
3.Go to: tools==>Notices & slips==>Edit (one notice)
4.Click on the "Email" in the Default, uncheck the checkbox for 'HTML Messages'.
5.Save
6.Reopen the notice, nothing changed.
7.Apply the patch
8.Repeat the steps 4 and 5
9.Success.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 7 Bin Wen 2019-10-09 12:33:05 UTC
(In reply to Katrin Fischer from comment #5)
> Ok... it cannot be unchecked it seems.

Hi Katrin, thanks for reminding me to add it to the test plan. Only when you enter the subject and content and save it will the corresponding language email  template be generated in the table 'letter'.


To test:
1.Enable multi-languages
2.Set the preference 'TranslateNotices' on  'Allow'
3.Go to: tools==>Notices & slips==>Edit (one notice)
4.Make sure that multilingual email templates are not empty.
5.Click on the "Email" in the "Default" tab, change the checkbox status of 'HTML Messages'.
6.Save
7.Reopen the notice, nothing changed.
8.Apply the patch
9.Repeat the steps 4 and 5
10.Success.
Comment 8 Martin Renvoize 2019-11-01 11:23:01 UTC
Created attachment 94948 [details] [review]
Bug 23762: Editing is_html status of email template fails under multi-languages

To test:
1.Enable multi-languages
2.Set the preference 'TranslateNotices' on  'Allow'
3.Go to: tools==>Notices & slips==>Edit (one notice)
4.Click on the "Email" in the Default, uncheck the checkbox for 'HTML Messages'.
5.Save
6.Reopen the notice, nothing changed.
7.Apply the patch
8.Repeat the steps 4 and 5
9.Success.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 9 Martin Renvoize 2019-11-01 11:24:48 UTC
Code makes sense, bug replicated and proved to be resolved by this patch.

Passes QA scripts and although I'd love to have seen an accompanying selenium test that's not a blocker.

Passing QA.

Minor note.. please remember to alter the 'Importance' of bugs.. This was labelled as an enhancement when in my mind it's a bug.

Nice work finding and fixing though Bin Wen
Comment 10 Martin Renvoize 2019-11-03 07:47:29 UTC
Nice work!

Pushed to master for 19.11.00