Site: .../cgi-bin/koha/admin/usage_statistics.pl If you try to select a country, you get an error: == The value of your system preference 'UsageStatsCountry' is not valid (Germany). Please select a valid one. == It doesn't matter which country you chose, no country is valid.
Confirmed. There is also an error message: Note: The value of your system preference 'UsageStatsCountry' is not valid (Algeria). Please select a valid one. The pull down appears to be the same as for UsageStatsCountry system preference. Not sure what the right fix here would be.
Created attachment 176822 [details] [review] Bug 36163: Usage statistics - Not possible to select a country Site: .../cgi-bin/koha/admin/usage_statistics.pl If you try to select a country, you get an error: == The value of your system preference 'UsageStatsCountry' is not valid (Germany). Please select a valid one. == It doesn't matter which country you chose, no country is valid. Test plan: ========== 1. Select a country for UsageStatsCountry system preference. 2. Go to http://<your addr>:8081/cgi-bin/koha/admin/usage_statistics.pl 3. Confirm the issue. 4. Apply the patch ; restart_all. 5. Repeat p. 2. 6. Confirm that the issue has been solved. Sponsored-by: Ignatianum University in Cracow
Created attachment 176831 [details] [review] Bug 36163: Usage statistics - Not possible to select a country Site: .../cgi-bin/koha/admin/usage_statistics.pl If you try to select a country, you get an error: == The value of your system preference 'UsageStatsCountry' is not valid (Germany). Please select a valid one. == It doesn't matter which country you chose, no country is valid. Test plan: ========== 1. Select a country for UsageStatsCountry system preference. 2. Go to http://<your addr>:8081/cgi-bin/koha/admin/usage_statistics.pl 3. Confirm the issue. 4. Apply the patch ; restart_all. 5. Repeat p. 2. 6. Confirm that the issue has been solved. Sponsored-by: Ignatianum University in Cracow Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Then I think should remove the trim later: <option value="[% country.trim | html %]" selected="selected">[% country.trim | html %]</option> IMO the best solution would be to trim at the beginning of the loop, but I guess yours also works.
Created attachment 176954 [details] [review] Bug 36163: Usage statistics - Not possible to select a country Site: .../cgi-bin/koha/admin/usage_statistics.pl If you try to select a country, you get an error: == The value of your system preference 'UsageStatsCountry' is not valid (Germany). Please select a valid one. == It doesn't matter which country you chose, no country is valid. Test plan: ========== 1. Select a country for UsageStatsCountry system preference. 2. Go to http://<your addr>:8081/cgi-bin/koha/admin/usage_statistics.pl 3. Confirm the issue. 4. Apply the patch ; restart_all. 5. Repeat p. 2. 6. Confirm that the issue has been solved. Sponsored-by: Ignatianum University in Cracow Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
(In reply to Jonathan Druart from comment #4) > Then I think should remove the trim later: > > <option value="[% country.trim | html %]" selected="selected">[% > country.trim | html %]</option> > > IMO the best solution would be to trim at the beginning of the loop, but I > guess yours also works. Updated. Thanks, Jonathan. The mine didn't work for Zimbabwe (last from the list) anyway - there must have been a space added that obviously was not removed by split.
Created attachment 176955 [details] [review] Bug 36163: Usage statistics - Not possible to select a country Site: .../cgi-bin/koha/admin/usage_statistics.pl If you try to select a country, you get an error: == The value of your system preference 'UsageStatsCountry' is not valid (Germany). Please select a valid one. == It doesn't matter which country you chose, no country is valid. Test plan: ========== 1. Select a country for UsageStatsCountry system preference. 2. Go to http://<your addr>:8081/cgi-bin/koha/admin/usage_statistics.pl 3. Confirm the issue. 4. Apply the patch ; restart_all. 5. Repeat p. 2. 6. Confirm that the issue has been solved. Sponsored-by: Ignatianum University in Cracow Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Created attachment 176956 [details] [review] Bug 36163: Chomp country list I found the same code in preferences.tt, actually we don't need to trim if the list is properly generated (ie. without extra spaces)
Janusz, I think this is actually the correct fix, what do you think? Ideally country-list.inc could return an array but I think it will be problematic to have a TT directive on several lines (it breaks the translation script).
(In reply to Jonathan Druart from comment #9) > Janusz, I think this is actually the correct fix, what do you think? Sure, it's simpler and cleaner with ~ . The main point is that the issue is identified and resolved :) Thanks, Jonathan, for having a deeper look into it.
Really glad to see this fixed after such a long time!
Pushed for 25.05! Well done everyone, thank you!
*** Bug 39013 has been marked as a duplicate of this bug. ***