Bug 27822

Summary: Wrong systempreference for AddressFormat (es-ES)
Product: Koha Reporter: verolencinas <verolencinas>
Component: PatronsAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: andrew, fridolin.somers, gmcharlt, jonathan.druart, kyle.m.hall
Version: Main   
Hardware: All   
OS: Linux   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.05.00,20.11.04
Circulation function:
Bug Depends on: 24973    
Bug Blocks:    
Attachments: Bug 27822: Fix default value for AddressFormat (es-ES)

Description verolencinas 2021-03-01 13:20:48 UTC
Koha 20.11 has as default "AddressFormat" systempreference "US". If you want to create a new user, you get the error "Template process failed: file error - member-main-address-style-US: not found at /usr/share/koha/lib/C4/Templates.pm line 122" because the system expects "us", not "US".
Changing the systempreference solves the problem.
Comment 1 Jonathan Druart 2021-03-02 14:11:51 UTC
Which exact version of 20.11? It works for me on the latest (20.11.03).
Comment 2 Jonathan Druart 2021-03-02 14:13:31 UTC
Right, scratch the last comment.

How did you end up with "US" instead of "us"?

It looks ok in the installer data (installer/data/mysql/mandatory/sysprefs.sql):
 13 ('AddressFormat','us','us|de|fr','Choose format to display postal addresses', 'Choice'),
Comment 3 verolencinas 2021-03-02 14:14:16 UTC
I had this problem updating 19.11 to 20.11.03.
Comment 4 verolencinas 2021-03-02 14:18:30 UTC
My sysprefs.sql is ok. I'm closing this bug.
Comment 5 verolencinas 2021-03-02 14:23:47 UTC
The "US" in AddressFormat is in installer/data/mysql/localization/es-ES/custom.sql
Comment 6 Jonathan Druart 2021-03-02 15:09:54 UTC
Created attachment 117527 [details] [review]
Bug 27822: Fix default value for AddressFormat (es-ES)

It must be "us" not "US" otherwise you get
Template process failed: file error - member-main-address-style-US: not found at /usr/share/koha/lib/C4/Templates.pm line 122" because the system expects "us", not "US".
Comment 7 Jonathan Druart 2021-03-02 15:11:06 UTC
Indeed, thanks!

A workaround is to, using the UI, save it to another value than "us", then back to "us". It should be set to "us" in DB.
Comment 8 Jonathan Druart 2021-03-03 10:59:44 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 9 Fridolin Somers 2021-03-04 12:17:56 UTC
Pushed to 20.11.x for 20.11.04
Comment 10 Andrew Fuerste-Henry 2021-03-14 18:56:05 UTC
Missing dependency, not backported to 20.05