Unique field validation fails with custom locale folders in AEM Content Fragments
Custom locale folder names in AEM cause unique field validation errors because they aren’t recognized as language roots. To fix this, set the jcr:language property on the folder to the correct ISO language code so AEM applies proper locale scoping.
Description description
Environment
- Product: Adobe Experience Manager as a Cloud Service (AEMaaCS) – Sites
- Constraint: Issue occurs when using custom locale folder names instead of standard ISO language codes.
Issue/Symptoms
- Unique field validation fails when creating content fragments with identical values in different locale folders that use non-standard language code names.
- For example, using
mxinstead of an ISO code likees_MXcauses AEM to treat the folders as part of the same scope, resulting in unexpected uniqueness errors.
Resolution resolution
To resolve the issue, follow these steps:
- Navigate to the custom locale folder (for example,
/mx) in AEM. - Access the
jcr:contentnode within this folder. - Set the property
jcr:languageto the appropriate ISO language code (for example,es_MX). - Save and commit changes in AEM.
- Create or update content fragments with identical unique field values in different locale folders and verify that no uniqueness validation error occurs.
Note:Setting the jcr:language property allows business-specific folder naming while maintaining correct locale scoping for unique fields and translation workflows.
Related Reading
Defining Content Fragment Models in the AEMaaCS User Guide
recommendation-more-help
3d58f420-19b5-47a0-a122-5c9dab55ec7f