#111187Record API resolves inline children of every language for a parent
Description
The record API (RecordFactory → RelationResolver → RelationHandler::readForeignField()) selects inline children (foreign_field) by the parent uid only. It never filters them by language. In language 0 the overlay does nothing, so translated children end up in the default language list. In other languages the overlay adds the translation a second time.
This is not a regression: relation resolving in the record API came with 13.3 (#104001) and never had a language condition. Reproduced on main (sqlite, mariadb, postgres), live as well as in a workspace. blog_example, parent and children on page 2:
Case 1, untranslated parent: blog 23 (L0); post 7 “English” (L0), post 8 “Deutsch” (L1, l18n_parent 7), post 9 “Deutsch frei” (L1, free); all blog=23. This data shape comes from DataHandler localize on a single child (list module, translation extensions): the translation keeps the default parent, even when a translated parent exists.
- Record API, language 0, all overlay types: 7, 8, 9
- Record API, language 1, on / mixed / includeFloating: 7 (overlaid with 8), 8, 9 → “Deutsch” twice
- Record API, language 1, off: 7, 8, 9
CONTENTwith the same data: language 0: 7; language 1 on: 7 (overlaid with 8); mixed / includeFloating: 7 (overlaid with 8), 9; off: 8, 9
Case 2, parent with language -1 (valid data, a -1 parent has no translation): blog 30 (L-1); 31 (L0), 32 (L1, l18n_parent 31), 33 (L-1), 34 (L1, free); all blog=30.
- Record API, language 0 and language 1 off: 31, 32, 33, 34
- Record API, language 1 on / mixed / includeFloating: 31 (overlaid with 32), 32, 33, 34
CONTENT: language 0: 31, 33; language 1 on: 31 (overlaid with 32), 33; mixed / includeFloating: 31 (overlaid with 32), 33, 34; off: 32, 33, 34
Cause:
RelationHandler::readForeignField()restricts byforeign_field,foreign_table_field,foreign_match_fields, deleted and workspace. It has never had a language condition (git log -S).GreedyDatabaseBackendoverlays the children withPageRepository::getLanguageOverlay(), which only acts ifLanguageAspect::doOverlays()is true, and that is false for language 0. The guard “When default language is displayed, we never want to return a record carrying another language” ingetLanguageOverlay()is therefore never reached. In other languages the overlaid default child and its translation are both in the list.
FormEngine and RelationHandler used directly return all children as well (7, 8, 9). That fits the backend: it relies on children pointing to the parent of their own language (see #80311). The record API serves the frontend, though, and CONTENT filters by language there.
Open question: should the record API follow CONTENT (language 0: children with 0 and -1; other languages: overlay by the overlay type, without duplicates)? Is the unfiltered list in FormEngine intended?
Reviews 1
Related issues 4
History 45
-
Alexander Schnitzler changed Related to #110082 <span data-processor="relativetime" data-value="2026-10-21T07:01:16+00:00" > 10/21/26, 07:01 </span>
-
Alexander Schnitzler changed Related to #80311 <span data-processor="relativetime" data-value="2026-10-21T07:01:21+00:00" > 10/21/26, 07:01 </span>
-
Alexander Schnitzler changed Related to #104001 <span data-processor="relativetime" data-value="2026-10-21T07:01:22+00:00" > 10/21/26, 07:01 </span>
-
Gerrit Code Review pushed patch set 1 for main to change 96963 status
NewUnder Review <span data-processor="relativetime" data-value="2026-10-21T08:50:14+00:00" > 10/21/26, 08:50 </span> -
Georg Ringer changed Related to #110183 <span data-processor="relativetime" data-value="2026-10-23T05:47:44+00:00" > 10/23/26, 05:47 </span>