Bugfix: Inline child of an untranslatable parent
Description
Between 6.0.4 and 6.0.5 - and 5.1.7 to 5.1.8 on the 5.1 line - translating file metadata created nothing at all.
sys_ declares sys_ as a connected mode inline child through
a foreign_ pointer:
// typo3/cms-core Configuration/TCA/sys_file.php
'metadata' => [
'config' => [
'type' => 'inline',
'foreign_table' => 'sys_file_metadata',
'foreign_field' => 'file',
],
],
but sys_ itself has neither language nor trans and
can therefore never carry a localization, while sys_ has both.
Inline checked
only that a candidate parent field points at the child table, carries no MM and
has a non-empty foreign_. It did not ask whether the parent table can be
translated at all. Metadata records were therefore treated as inline children and
their localization was handed over to
\TYPO3\ on the
parent - which, without a parent localization, creates nothing. That behaviour is
correct and documented, so the translated metadata record simply never appeared.
Two fixes were needed, because the wrong answer was given at two levels:
- The per-record resolution now reports the new state
\Webfor an inline child whose parent table is not translatable. It carries no reference and is not a broken relation, so the hook falls through to the regular localization and the child is localized on its own - the behaviour from before the inline relation resolution was introduced.Vision\ Deepltranslate\ Core\ Domain\ Enum\ Inline Parent State:: Parent Not Translatable isnow counts only parents which can carry a localization themselves. Callers use it to decide whether a record has to be localized through its parent, and they have to decide that before the pointer column of a newly created child record is written, so the per-record resolution is not available to them. ForPossible Inline Child Table () sys_, owned exclusively by the untranslatablefile_ metadata sys_, the old answer made callers skip the record entirely - which kept file metadata untranslated even with the per-record resolution fixed.file
Both checks share one predicate, so they cannot drift apart.
Impact
File metadata is translated again, as it was up to 6.0.3 and 5.1.6.
More generally, an inline child in connected mode whose parent table is not translatable is localized on its own instead of being handed to a parent which can never carry a localization. The state is deliberately silent - it is a regular record configuration, not a broken relation, and is not reported to the editor.
Detecting whether a table can be an inline child at all is otherwise unchanged.
Released in 6.0.6 and 5.1.9. See issue #618.