Closed mkarulin closed 1 year ago
Could it be, that you are in the wrong repository? There is no 11.0.0 version in here, but there is one in the private repository, that you should have access to. So could you please report bugs about that version there, so we don't get lost?
Additionally you might want to check the inlineTablesConfig feature, which can be found in Classes/Model/L10nBaseService.php
/*
* Special handling for 1:n relations
*
* Example: Inline elements (1:n) with tt_content as parent
*
* Config example:
* $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['l10nmgr']['inlineTablesConfig'] = [
* 'tx_myext_myelement' => [
* 'parentField' => 'content',
* 'childrenField' => 'myelements',
* ]];
*/
It was introduced with 4cd1b7093b0a2c0c5e6ceb6f1036f9802b73cf7e
Since I am convinced that inlineTablesConfig
will do the job here, I will close the issue. Feel free to reopen it, if it doesn't.
@Bunnyfield thanks, but how would that work in this case: The parent record is named: "tx_lp_product" Child records tx_lp_domain_model_section and tx_lp_domain_model_keyfeature. Configuration i tried (In yaml format):
inlineTablesConfig:
tx_lp_domain_model_keyfeature:
parentField: 'product'
childrenField: 'keyfeature_sections'
tx_lp_domain_model_section:
parentField: 'product'
childrenField: 'custom_sections'
parent (tx_lp_product.php)
...
'custom_sections' => [
'exclude' => true,
'label' => 'custom_sections',
'config' => [
'type' => 'inline',
'allowed' => 'tx_lp_domain_model_section',
'foreign_table' => 'tx_lp_domain_model_section',
'foreign_sortby' => 'sorting',
'foreign_field' => 'product',
'minitems' => 0,
'maxitems' => 99,
],
],
'keyfeature_sections' => [
'exclude' => true,
'label' => 'keyfeature_sections',
'config' => [
'type' => 'inline',
'foreign_table' => 'tx_lp_domain_model_keyfeature',
'foreign_sortby' => 'sorting',
'foreign_field' => 'product',
'minitems' => 0,
'maxitems' => 99,
],
],...
parentField in tx_lp_domain_model_section.php & tx_lp_domain_model_keyfeature.php:
...
'product' => [
'config' => [
'type' => 'passthrough',
],
],
...
The point is, that a field of type "passthrough" by definition does not contain any information, that would be necessary to determine the actual relation for an automated translation process.
So actually this is the same problem as described in the other issue #8 : You have to provide additional knowledge, that is only available to you as an editor because you can see the given structure in the backend. The L10nmgr is somehow comparable to a blind user, who needs additional information about the relations between elements. If this is not given properly, it can not work the same way you would as a user.
TYPO3 version 11.5 l10nmgr version: 11.0.0 alpha
Description: The naming of the record tables seems to have an impact of the order of localization which can cause broken relations and duplicates:
Parent record of "tx_a_b" with inline field with "foreign_table" of "tx_a_a" creates 2 new child records, an invalid one that is attached to the default record of "tx_a_a", and another (the correct one) that is attached to the localization of "tx_a_a".
If i change the table and tca to more appropriate naming convention of tx_a_b and tx_a_b_a the file imports correctly with 1 new parent record and 1 new child record localizations.
In a single package it is possible to follow the correct naming convention but what if i require tables from another package? I think there should be a more elegant way to determine the order of localization.
How to reproduce: create 2 new TCA files and ext_tables.sql file:
Create record a_b (PARENT) and add to it a_a (CHILD). Export and import in another language
Expected results: 1 new localized parent + 1 new localized child
Actual results: 1 new localized parent + 2 new localized children, one connected to the wrong (default) languge.