Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-22395

Filter locales listed in Administration in order to ensure that the list contains only locales with the correct format

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 14.10.22, 15.10.12, 16.4.2, 16.7.0
    • 15.10.11, 16.4.1, 16.6.0
    • Windows 11 Pro, Chrome 127, using a local instance of XWiki 16.6.0 on MySQL 8.4, Tomcat 9.0.91
    • Unknown
    • N/A
    • N/A

    Description

      Steps to reproduce

      1. Login as Admin (tested with Java 21 from Oracle)
      2. Go to Administer Wiki > Content > Localization
      3. Set Multilingual to 'Yes'
      4. In Supported Languages and Default Language drop-downs search for locales like "Chinese (Simplified)" or "Brezhoneg (latin, Frans) (Breton (Latin, France))" or others that usually contain the alphabet ('latin', for ex)

      Expected results

      No warnings should be displayed in the logs, since the locales with wrong format should not be listed for selection.

      Actual results

      If these added to the Supported Languages and/or Default Language, they generate a huge stacktrace in console, like (partial stacktrace):

      E.g. for Chinese (Simplified):

      2024-08-06 12:38:24,107 [qtp1075738627-32 - http://localhost:1511/xwiki/bin/saveandcontinue/XWiki/XWikiPreferences] WARN  c.x.x.XWiki                    - Invalid locale [zh__#Hans] set as default locale in the preferences
      2024-08-06 12:38:24,107 [qtp1075738627-32 - http://localhost:1511/xwiki/bin/saveandcontinue/XWiki/XWikiPreferences] WARN  c.x.x.XWiki                    - Invalid locale [zh__#Hans] set as default locale in the preferences
      2024-08-06 12:38:24,109 [qtp1075738627-32 - http://localhost:1511/xwiki/bin/saveandcontinue/XWiki/XWikiPreferences] WARN  c.x.x.XWiki                    - Invalid locale [zh__#Hans] set as default locale in the preferences
      2024-08-06 12:38:24,109 [qtp1075738627-32 - http://localhost:1511/xwiki/bin/saveandcontinue/XWiki/XWikiPreferences] WARN  c.x.x.XWiki                    - Invalid locale [zh__#Hans] set as default locale in the preferences
      2024-08-06 12:38:24,206 [XWiki Solr index thread] WARN  c.x.x.XWiki                    - Invalid locale [zh__#Hans] set as default locale in the preferences
      2024-08-06 12:38:24,206 [qtp1075738627-32 - http://localhost:1511/xwiki/bin/saveandcontinue/XWiki/XWikiPreferences] WARN  c.x.x.XWiki                    - Invalid locale [zh__#Hans] set as default locale in the preferences
      2024-08-06 12:38:24,206 [XWiki Solr index thread] WARN  c.x.x.XWiki                    - Invalid locale [zh__#Hans] set as default locale in the preferences
      2024-08-06 12:38:24,207 [XWiki Solr index thread] WARN  c.x.x.XWiki                    - Invalid locale [zh__#Hans] set as default locale in the preferences
      2024-08-06 12:38:24,207 [XWiki Solr index thread] WARN  c.x.x.XWiki                    - Invalid locale [zh__#Hans] set as default locale in the preferences
      2024-08-06 12:38:24,207 [XWiki Solr index thread] WARN  c.x.x.XWiki                    - Invalid locale [zh__#Hans] set as default locale in the preferences
      2024-08-06 12:38:24,207 [XWiki Solr index thread] WARN  c.x.x.XWiki                    - Invalid locale [zh__#Hans] set as default locale in the preferences
      2024-08-06 12:38:24,208 [XWiki Solr index thread] WARN  c.x.x.XWiki                    - Invalid locale [zh__#Hans] set as default locale in the preferences
      2024-08-06 12:38:24,208 [XWiki Solr index thread] WARN  c.x.x.XWiki                    - Invalid locale [zh__#Hans] set as default locale in the preferences
      2024-08-06 12:38:24,209 [XWiki Solr index thread] WARN  c.x.x.XWiki                    - Invalid locale [zh__#Hans] set as default locale in the preferences
      2024-08-06 12:38:24,209 [XWiki Solr index thread] WARN  c.x.x.XWiki                    - Invalid locale [zh__#Hans] set as default locale in the preferences
      2024-08-06 12:38:24,211 [XWiki Solr index thread] WARN  c.x.x.XWiki                    - Invalid locale [zh__#Hans] set as default locale in the preferences
      2024-08-06 12:38:24,211 [XWiki Solr index thread] WARN  c.x.x.XWiki                    - Invalid locale [zh__#Hans] set as default locale in the preferences
      2024-08-06 12:38:24,212 [qtp1075738627-32 - http://localhost:1511/xwiki/bin/saveandcontinue/XWiki/XWikiPreferences] WARN  c.x.x.XWiki                    - Invalid locale [zh__#Hans] set as default locale in the preferences
      2024-08-06 12:38:24,212 [XWiki Solr index thread] WARN  c.x.x.XWiki                    - Invalid locale [zh__#Hans] set as default locale in the preferences
      2024-08-06 12:38:24,212 [qtp1075738627-32 - http://localhost:1511/xwiki/bin/saveandcontinue/XWiki/XWikiPreferences] WARN  c.x.x.XWiki                    - Invalid locale [zh__#Hans] set as default locale in the preferences
      2024-08-06 12:38:24,212 [XWiki Solr index thread] WARN  c.x.x.XWiki                    - Invalid locale [zh__#Hans] set as default locale in the preferences
      2024-08-06 12:38:24,212 [qtp1075738627-32 - http://localhost:1511/xwiki/bin/saveandcontinue/XWiki/XWikiPreferences] WARN  c.x.x.XWiki                    - Invalid locale [zh__#Hans] set as default locale in the preferences
      2024-08-06 12:38:24,213 [qtp1075738627-32 - http://localhost:1511/xwiki/bin/saveandcontinue/XWiki/XWikiPreferences] WARN  c.x.x.XWiki                    - Invalid locale [zh__#Hans] set as default locale in the preferences
      2024-08-06 12:38:24,213 [qtp1075738627-32 - http://localhost:1511/xwiki/bin/saveandcontinue/XWiki/XWikiPreferences] WARN  c.x.x.XWiki                    - Invalid locale [zh__#Hans] set as default locale in the preferences
      2024-08-06 12:38:24,213 [qtp1075738627-32 - http://localhost:1511/xwiki/bin/saveandcontinue/XWiki/XWikiPreferences] WARN  c.x.x.XWiki                    - Invalid locale [zh__#Hans] set as default locale in the preferences
      2024-08-06 12:38:24,213 [qtp1075738627-32 - http://localhost:1511/xwiki/bin/saveandcontinue/XWiki/XWikiPreferences] WARN  c.x.x.XWiki                    - Invalid locale [zh__#Hans] set as default locale in the preferences
      2024-08-06 12:38:24,214 [qtp1075738627-32 - http://localhost:1511/xwiki/bin/saveandcontinue/XWiki/XWikiPreferences] WARN  c.x.x.XWiki                    - Invalid locale [zh__#Hans] set as default locale in the preferences
      2024-08-06 12:38:24,214 [XWiki Solr index thread] WARN  c.x.x.XWiki                    - Invalid locale [zh__#Hans] set as default locale in the preferences
      2024-08-06 12:38:24,217 [qtp1075738627-32 - http://localhost:1511/xwiki/bin/saveandcontinue/XWiki/XWikiPreferences] WARN  c.x.x.XWiki                    - Invalid locale [zh__#Hans] set as default locale in the preferences
      2024-08-06 12:38:24,217 [qtp1075738627-32 - http://localhost:1511/xwiki/bin/saveandcontinue/XWiki/XWikiPreferences] WARN  c.x.x.XWiki                    - Invalid locale [zh__#Hans] set as default locale in the preferences
      2024-08-06 12:38:24,219 [qtp1075738627-32 - http://localhost:1511/xwiki/bin/saveandcontinue/XWiki/XWikiPreferences] WARN  c.x.x.XWiki                    - Invalid locale [zh__#Hans] set as default locale in the preferences
      2024-08-06 12:38:24,219 [qtp1075738627-32 - http://localhost:1511/xwiki/bin/saveandcontinue/XWiki/XWikiPreferences] WARN  c.x.x.XWiki                    - Invalid locale [zh__#Hans] set as default locale in the preferences
      2024-08-06 12:38:24,220 [qtp1075738627-32 - http://localhost:1511/xwiki/bin/saveandcontinue/XWiki/XWikiPreferences] WARN  c.x.x.XWiki                    - Invalid locale [zh__#Hans] set as default locale in the preferences
      2024-08-06 12:38:24,220 [qtp1075738627-32 - http://localhost:1511/xwiki/bin/saveandcontinue/XWiki/XWikiPreferences] WARN  c.x.x.XWiki                    - Invalid locale [zh__#Hans] set as default locale in the preferences
      2024-08-06 12:38:24,238 [qtp1075738627-32 - http://localhost:1511/xwiki/bin/saveandcontinue/XWiki/XWikiPreferences] WARN  c.x.x.XWiki                    - Invalid locale [zh__#Hans] set as default locale in the preferences
      2024-08-06 12:38:24,238 [qtp1075738627-32 - http://localhost:1511/xwiki/bin/saveandcontinue/XWiki/XWikiPreferences] WARN  c.x.x.XWiki                    - Invalid locale [zh__#Hans] set as default locale in the preferences

       

      Full stacktrace available at: https://up1.xwikisas.com/#wbc57NT8KYzsEZl7kyLUNA

      Attachments

        Issue Links

          Activity

            People

              tmortagne Thomas Mortagne
              iandriuta Ilie Andriuta
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: