Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Url-Mapping does not work with "real" locales (language/country combination, eg. "de_DE") #258

Closed
kartobi opened this issue Jun 11, 2014 · 1 comment

Comments

@kartobi
Copy link
Contributor

kartobi commented Jun 11, 2014

After wondering, why the url mapping does not work even though it is configured correctly in the appropriate xsd, I found out that it can't handle locales with language and country, like "de_DE".

The database entry for the mapping is written using Locale.toString():

[...]
cms.writeUrlNameMapping(
    nameSeq,
    resourceForUrlNameMapping.getStructureId(),
    value.getLocale().toString());
[...]

(CmsDefaultXmlContentHandler#resolveMapping(), line 1423ff)

But when readling the mapping only Locale.getLanguage() is used:

[...]
Locale bestLocale = localeManager.getBestMatchingLocale(locale, defaultLocales, availableLocales);
String bestLocaleStr = bestLocale.getLanguage();
for (CmsUrlNameMappingEntry entry : lastEntries) {
    if (entry.getLocale().equals(bestLocaleStr)) {
        return entry.getName();
    }
}
[...]

(CmsDriverManager#readBestUrlName(), line 6360ff)

So no mapping will be found and the structure id will be used.

@gWestenberger
Copy link
Contributor

Fixed in upcoming release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants