Bug 23765 - After TranslateNotices is set to 'Don't allow', email settings still show multiple languages
Summary: After TranslateNotices is set to 'Don't allow', email settings still show mul...
Status: Pushed to stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Notices (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Assignee: Jonathan Druart
QA Contact: Martin Renvoize
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-07 14:46 UTC by Bin Wen
Modified: 2019-11-15 12:43 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small 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 23765 - After TranslateNotices is set to 'Don't allow', email settings still show multiple languages (1.87 KB, patch)
2019-10-08 15:48 UTC, Bin Wen
Details | Diff | Splinter Review
Bug 23765: After TranslateNotices is set to 'Don't allow', email settings still show multiple languages (1.92 KB, patch)
2019-10-08 20:41 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 23765: Do not display localized templates if TranslateNotices is off (6.43 KB, patch)
2019-11-07 10:43 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 23765: Do not display localized templates if TranslateNotices is off (6.48 KB, patch)
2019-11-12 13:20 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 23765: Do not display localized templates if TranslateNotices is off (6.55 KB, patch)
2019-11-13 13:22 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Bin Wen 2019-10-07 14:46:03 UTC
tools==>Notices & slips==>Edit.
When multilingual is enabled , add multilingual email templates.
Set the preference TranslateNotices to 'Don't allow'.
The email setting should show only the default,but now it just changed from 'tab' to 'list', still showing all the language settings.
Comment 1 Bin Wen 2019-10-08 15:48:48 UTC
Created attachment 93887 [details] [review]
Bug 23765 - After TranslateNotices is set to 'Don't allow', email settings still show multiple languages

To test:
1. Enable multi-languages
2. Set the preference 'TranslateNotices' on  'Allow'
3. Go to: tools==>Notices & slips==>Edit, make sure it has multilingual email templates.
4. Set the preference TranslateNotices on 'Don't allow'.
5. Go to: tools==>Notices & slips==>Edit ,the template still shows all the languages.
6. Apply the patch.
7. Repeat the steps 4 and 5
8. Success. It only shows the default template when TranslateNotices is 'Dont allow'.
Comment 2 Katrin Fischer 2019-10-08 20:41:14 UTC
Created attachment 93903 [details] [review]
Bug 23765: After TranslateNotices is set to 'Don't allow', email settings still show multiple languages

To test:
1. Enable multi-languages
2. Set the preference 'TranslateNotices' on  'Allow'
3. Go to: tools==>Notices & slips==>Edit, make sure it has multilingual email templates.
4. Set the preference TranslateNotices on 'Don't allow'.
5. Go to: tools==>Notices & slips==>Edit ,the template still shows all the languages.
6. Apply the patch.
7. Repeat the steps 4 and 5
8. Success. It only shows the default template when TranslateNotices is 'Dont allow'.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 3 Katrin Fischer 2019-10-08 20:42:57 UTC
Note: I can only see the problem, if I add something to a translated template first. Then with turning off the pref, this tab will remain in the list, so you end up with 2 email tabs and can't see which language it is anymore.
Comment 4 Martin Renvoize 2019-11-01 10:15:38 UTC
Hmmm, 

I'm wondering if this should be caught at a higher level.. the issue to me is that C4::Letters::GetLetterTemplates returns multiple languages even if TranslateNotices is set to "Don't allow"... I'm wondering if fixing it at this level would catch some other cases where TranslateNotices isn't being checked perhaps?
Comment 5 Jonathan Druart 2019-11-07 10:43:05 UTC
Created attachment 95136 [details] [review]
Bug 23765: Do not display localized templates if TranslateNotices is off

To test:
1. Enable multi-languages
2. Set the preference 'TranslateNotices' on  'Allow'
3. Go to: tools==>Notices & slips==>Edit, make sure it has multilingual
email templates.
4. Set the preference TranslateNotices on 'Don't allow'.
5. Go to: tools==>Notices & slips==>Edit, the template shows several tab
for the same transport type.
6. Apply the patch.
7. Repeat the steps 4 and 5
8. Success. It only shows the default template when TranslateNotices is
'Dont allow'.
Comment 6 Jonathan Druart 2019-11-07 10:43:36 UTC
(In reply to Martin Renvoize from comment #4)
> Hmmm, 
> 
> I'm wondering if this should be caught at a higher level.. the issue to me
> is that C4::Letters::GetLetterTemplates returns multiple languages even if
> TranslateNotices is set to "Don't allow"... I'm wondering if fixing it at
> this level would catch some other cases where TranslateNotices isn't being
> checked perhaps?

Yes, definitely!
Comment 7 Martin Renvoize 2019-11-12 09:43:39 UTC
Thanks for implementing that Jonathan, looks great... Just testing it now.

Thanks Bin Wen for raising it and submitting the first version :)
Comment 8 Martin Renvoize 2019-11-12 13:20:28 UTC
Created attachment 95306 [details] [review]
Bug 23765: Do not display localized templates if TranslateNotices is off

To test:
1. Enable multi-languages
2. Set the preference 'TranslateNotices' on  'Allow'
3. Go to: tools==>Notices & slips==>Edit, make sure it has multilingual
email templates.
4. Set the preference TranslateNotices on 'Don't allow'.
5. Go to: tools==>Notices & slips==>Edit, the template shows several tab
for the same transport type.
6. Apply the patch.
7. Repeat the steps 4 and 5
8. Success. It only shows the default template when TranslateNotices is
'Dont allow'.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 9 Martin Renvoize 2019-11-12 13:20:54 UTC
Works well, Signing off.
Comment 10 Katrin Fischer 2019-11-13 13:22:10 UTC
Created attachment 95375 [details] [review]
Bug 23765: Do not display localized templates if TranslateNotices is off

To test:
1. Enable multi-languages
2. Set the preference 'TranslateNotices' on  'Allow'
3. Go to: tools==>Notices & slips==>Edit, make sure it has multilingual
email templates.
4. Set the preference TranslateNotices on 'Don't allow'.
5. Go to: tools==>Notices & slips==>Edit, the template shows several tab
for the same transport type.
6. Apply the patch.
7. Repeat the steps 4 and 5
8. Success. It only shows the default template when TranslateNotices is
'Dont allow'.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 11 Martin Renvoize 2019-11-13 13:37:02 UTC
Nice work!

Pushed to master for 19.11.00
Comment 12 Fridolin SOMERS 2019-11-15 12:43:40 UTC
Pushed to 19.05.x for 19.05.05