Reputation: 5122
I had to import a few posts from one TYPO3 site into another, which lead into some exploring of the DB structure. A specific question arose:
In localised content elements (tt_content entries with sys_language_uid = 1), the fields t3_origuid
and l18n_parent
are redundantly filled. l18n_parent
is required for the backend localisation view to work.
Do they always have the same value? Or is there a use case where the values of the fields can differ?
Upvotes: 1
Views: 2686
Reputation: 674
The field configured in TCA as transOrigPointerField
(usually l10n_parent
or l18n_parent
) is used for localization.
It always contains an id of the record in the default language (even if the record was translated from a record in non-default language), see https://docs.typo3.org/typo3cms/TCAReference/singlehtml/#transorigpointerfield
The field configured in TCA as origUid
(usually t3_origuid
) is filled when record is copied or translated, and contains an id of the source record, see https://docs.typo3.org/typo3cms/TCAReference/singlehtml/#origuid
The fields will have the same value in some cases (e.g. translating a record from default language), but in other will have different value. E.g. when copying a record on the same page t3_origuid
will be different than the l10n_parent
.
To allow localization it is required to have transOrigPointerField
(l10n_parent
). Having origUid
(t3_origuid
) field is not hard requirement but a good practice as as some additional features may require it to work. Especially in newer versions of TYPO3. For example the Translation Wizard is currently using t3_origuid
field.
Since TYPO3 8.6 a new database field l10n_source
for tt_content
table has been introduced together with a new TCA ctrl configuration translationSource
. The translationSource
field contains an uid of the record used as a translation source, no matter whether the record was translated in the free or connected mode.
see more in the documentation on l10n_source field
Upvotes: 5
Reputation: 55798
Just as a addition to Jost's post:
To determine which field you should use check the value of:
$TCA['tx_yourtable']['ctrl']['transOrigPointerField']
ie. for tt_content
it's:
$TCA['tt_content']['ctrl']['transOrigPointerField'] = 'l18n_parent';
Upvotes: 2
Reputation: 5840
Those fields can have different values.
t3_origuid
is a generic field pointing to a record from which the current one was derived in some way. For example by copying or localizing it. Here is some documentation for it.
The field l18n_parent
is reserved for localization purposes.
Upvotes: 3