Skip to content

[DEFECT] Relationship fields return default language content instead of localized content when using depth parameter #34289

@nicobytes

Description

@nicobytes

Problem Statement

When querying a specific language version of a content item using the REST API (api/v1/content/{id}) with the depth parameter (e.g., depth=2), the related content inside the relationship field is returned to the default language (Language 1). The system fails to respect the language context of the parent item, returning the relationship associated with the default language instead of the one explicitly defined for the localized version.

Steps to Reproduce

Evidence from User:

Context: The user has a content item with two language versions (English and Spanish).

Configuration:

English Version relates to "Item 1 - English".
Spanish Version relates to "Item 1 - Spanish".

API Response: When requesting the Spanish version (verified by "languageId": 2 in the root response), the relationshipField returns an object with "languageId": 1 (English), ignoring the Spanish relationship assignment.

support-3.mp4
Image Image

Acceptance Criteria

The API response must respect the language of the requested content item when hydrating relationships.

dotCMS Version

latest

Severity

Critical - System unusable

Links

https://dotcms.freshdesk.com/a/tickets/34618

Metadata

Metadata

Type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions