Description
When using the SDK's getCollection() method with .language() and .depth() parameters, the main content is returned in the correct locale, but relationship field children are returned in the default language instead of the specified locale.
Steps to Reproduce
- Have a dotCMS instance with multiple languages (e.g., English as default, French as secondary)
- Create a content type with a relationship field
- Create content with relationships in both languages
- Use the SDK to fetch content with language and depth:
client.content
.getCollection("MyContentType")
.language(4600065) // French
.depth(3) // Include relationships
https://dotcms.freshdesk.com/a/tickets/34618
Expected Result
Both the main content AND all relationship field children should be returned in the specified language (French).
Actual Result
- Main content: Returned in French ✅
- Relationship children: Returned in English (default language) ❌
Affected Component
@dotcms/client SDK - CollectionBuilder
Workaround
Make direct API calls to /api/content/_search with languageId included as a separate field in the POST body.
Acceptance Criteria
Severity
Low- Minor Issue