Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-4630

System default locale not in allowed_locales, causes AdminService error

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Must
    • Resolution: Fixed
    • Affects Version/s: Platform 1.12.0
    • Fix Version/s: Platform 2.0.0
    • Component/s: None
    • Labels:
      None
    • Complexity:
      Low

      Description

      Validation was added in https://issues.openmrs.org/browse/TRUNK-4429 that prevents the list of allowed locales (global property locale.allowed.list) from being saved unless the list includes the default locale. It also prevents default_locale from being saved unless the default locale is in the allowed locales list.

      It is possible, however, to install OpenMRS without setting a default locale at all. When this happens, OpenMRS uses en_GB as the default locale (from LocaleUtility.getDefaultLocale()). However, the default list of allowed locales is "en, es, fr, it, pt", from OpenmrsConstants.

      This is problematic in 2 ways, because errors are thrown when either property value is inserted:

      INFO - LoggingAdvice.invoke(119) |2015-03-03 22:51:53,760| In method AdministrationService.saveGlobalProperty. Arguments: GlobalProperty=property: locale.allowed.list value: en, es, fr, it, pt,
      ERROR - LoggingAdvice.invoke(139) |2015-03-03 22:51:53,793| An error occurred while executing this method.
      Current user: daemon
      Error message: "en_GB" can not be removed from allowed locales list because it is the default locale
      org.openmrs.api.APIException: "en_GB" can not be removed from allowed locales list because it is the default locale

      and

      ERROR - Context.checkCoreDataset(1096) |2015-03-03 22:30:59,553| Error while setting core global properties
      org.openmrs.api.APIException: "en_GB" is not in allowed locales list
      at org.openmrs.api.impl.AdministrationServiceImpl.saveGlobalProperty(Adm
      inistrationServiceImpl.java:707)

      Semantically it makes little sense to have the system default to a locale that is not allowed by default. Therefore one straightforward solution is to allow en_GB by default (or change the default locale to en, which is supported)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              kristopherschmidt Kristopher Schmidt
              Reporter:
              kristopherschmidt Kristopher Schmidt
              Designated Committer:
              Rafal Korytkowski
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: