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 mx instead of an ISO code like es_MX causes 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:

  1. Navigate to the custom locale folder (for example, /mx) in AEM.
  2. Access the jcr:content node within this folder.
  3. Set the property jcr:language to the appropriate ISO language code (for example, es_MX).
  4. Save and commit changes in AEM.
  5. 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