Bug 11265 - Problems with locale saving/editing on serial subscriptions
Summary: Problems with locale saving/editing on serial subscriptions
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Serials (show other bugs)
Version: 3.14
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 7688
Blocks: 11263
  Show dependency treegraph
 
Reported: 2013-11-17 23:58 UTC by Katrin Fischer
Modified: 2015-06-04 23:23 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 11265: the locale value is not selected on editing a subscription (2.13 KB, patch)
2013-11-19 10:31 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 11265: the locale value is not selected on editing a subscription (3.50 KB, patch)
2013-11-19 13:10 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 11265: the locale value is not selected on editing a subscription (3.48 KB, patch)
2013-11-19 13:15 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 11265: the locale value is not selected on editing a subscription (2.13 KB, patch)
2013-11-19 13:19 UTC, Jonathan Druart
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 11265: the locale value is not selected on editing a subscription (2.44 KB, patch)
2013-11-24 22:41 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
[PASSED QA] Bug 11265: the locale value is not selected on editing a subscription (2.66 KB, patch)
2013-11-25 07:14 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 Katrin Fischer 2013-11-17 23:58:12 UTC
While writing the patch for 11264 I tried a few things with the new locale setting. There are 2 notable problems:

1) When you explicitly pick a locale it is save to the database correctly, but when you edit the subscription later, the pull down is shown empty.

2) It didn't detect my system locale correctly. I am not sure if I am missing an additional thing in the code? After applying 11264 and picking de-DE explicitly the season names show in German.
But if I don't pick the locale, the season names are in English. 
I can't test this with French right now, maybe someone else can?

That's the result of running locale on my system:
LANG=de_DE.UTF-8
LANGUAGE=de_DE:en
LC_CTYPE="de_DE.UTF-8"
LC_NUMERIC="de_DE.UTF-8"
LC_TIME="de_DE.UTF-8"
LC_COLLATE="de_DE.UTF-8"
LC_MONETARY="de_DE.UTF-8"
LC_MESSAGES="de_DE.UTF-8"
LC_PAPER="de_DE.UTF-8"
LC_NAME="de_DE.UTF-8"
LC_ADDRESS="de_DE.UTF-8"
LC_TELEPHONE="de_DE.UTF-8"
LC_MEASUREMENT="de_DE.UTF-8"
LC_IDENTIFICATION="de_DE.UTF-8"
LC_ALL=
Comment 1 Jonathan Druart 2013-11-19 10:31:06 UTC Comment hidden (obsolete)
Comment 2 Jonathan Druart 2013-11-19 10:34:13 UTC
(In reply to Katrin Fischer from comment #0)
> While writing the patch for 11264 I tried a few things with the new locale
> setting. There are 2 notable problems:
> 
> 1) When you explicitly pick a locale it is save to the database correctly,
> but when you edit the subscription later, the pull down is shown empty.

Should be fix by the patch.

> 2) It didn't detect my system locale correctly. I am not sure if I am
> missing an additional thing in the code?

In fact Apache does not export the system locales.
A workaround would be to export the needed value in the Apache conf:
  SetEnv LC_TIME 'LANG.utf8' (with LANG is fr_FR or de_DE, etc.)
Comment 3 Katrin Fischer 2013-11-19 12:59:32 UTC
Depending on the server locale is a bit worrying to me. Is it possible to investigate other ways here? Like having a system preference list or an authorized value?

When Apache doesn't support locales, then this can never have worked. Maybe we should remove the hint from the template in that case.
Comment 4 Jonathan Druart 2013-11-19 13:10:25 UTC Comment hidden (obsolete)
Comment 5 Jonathan Druart 2013-11-19 13:11:05 UTC
(In reply to Katrin Fischer from comment #3)
> Depending on the server locale is a bit worrying to me. Is it possible to
> investigate other ways here? Like having a system preference list or an
> authorized value?
> 
> When Apache doesn't support locales, then this can never have worked. Maybe
> we should remove the hint from the template in that case.

I will propose another way on another bug.
Comment 6 Jonathan Druart 2013-11-19 13:15:08 UTC Comment hidden (obsolete)
Comment 7 Jonathan Druart 2013-11-19 13:19:04 UTC Comment hidden (obsolete)
Comment 8 Jonathan Druart 2013-11-19 13:19:44 UTC
The 4th step in the test plan was wrong.
Comment 9 Bernardo Gonzalez Kriegel 2013-11-24 22:41:01 UTC Comment hidden (obsolete)
Comment 10 Katrin Fischer 2013-11-25 07:14:41 UTC
Created attachment 23126 [details] [review]
[PASSED QA] Bug 11265: the locale value is not selected on editing a subscription

Test plan:
0/ you have to have some locales defined, run dpkg-reconfigure locales
to configure locales
1/ edit a subscription (or add a new one) and select a locale
2/ save
3/ edit again and verify the locale value is selected

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Work as described. No koha-qa errors.

Tested creating a suscription, selecting locale (have many) and saving.
When editing suscription:
1) Without patch locale value is not showed on page, empty value
2) With patch correct value is displayed

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script. Template change only.
Works as expected - saved locale is now shown on editing the
subscription and will not be deleted upon saving.
Comment 11 Galen Charlton 2013-12-05 19:02:28 UTC
Pushed to master.  Thanks, Jonathan!
Comment 12 Fridolin Somers 2013-12-17 17:33:32 UTC
This patch has been pushed to 3.14.x, will be in 3.14.1