Bug #90780
closedCustom Doktypes / Translation / pages recursive
0%
Description
Hello,
we are migrating a website from TYPO3 8 to 9. I use custom Doktypes and translations (German, Italian, French).
Following Page-Types:- Wine-Object
- Winevintage-Object
Winevintage-Object is linked to Wine-Object by pid.
TCA-Override of pages.php:
'vintages' => [
'exclude' => 1,
'label' => 'Jahrgänge',
'config' => [
'type' => 'inline',
'foreign_table' => 'pages',
'foreign_field' => 'pid',
'appearance' => [
......
]
],
],
Now after migration when I) fetch the wine object ) have in the ObjectStorage of the wine 3 Vintage-Objects (for German, Italian and France). I have done the migration and in the pages table everything look good (https://docs.typo3.org/c/typo3/cms-core/master/en-us/Changelog/9.0/Important-82445-MigratePagesLanguageOverlayIntoPages.html).
Wine-Model:
<?php
class Wine extends BasicPage
{
/**
* __construct
*/
public function __construct()
{
parent::__construct();
$this->initStorageObjects();
}
/**
* Initializes all ObjectStorage properties
* Do not modify this method!
* It will be rewritten on each save in the extension builder
* You may modify the constructor of this class instead
*
* @return void
*/
protected function initStorageObjects()
{
$this->vintages = new ObjectStorage();
}
/**
* vintages
*
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Varioous\VaAldivinoteca\Domain\Model\Winevintage>
*/
protected $vintages;
/**
* @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage
*/
public function getVintages()
{
return $this->vintages;
}
/**
* @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $vintages
*/
public function setVintages(ObjectStorage $vintages)
{
$this->vintages = $vintages;
}
}
Winevintage-Model:
class Winevintage extends BasicPage
{
/**
* wine
*
* @var \Varioous\VaAldivinoteca\Domain\Model\Wine
*/
protected $wine = null;
/**
* @return \Varioous\VaAldivinoteca\Domain\Model\Wine
*/
public function getWine()
{
return $this->wine;
}
/**
* @param \Varioous\VaAldivinoteca\Domain\Model\Wine $wine
*/
public function setWine(\Varioous\VaAldivinoteca\Domain\Model\Wine $wine)
{
$this->wine = $wine;
}
}
Table-Mapping:
# map pages and winevintage
config.tx_extbase.persistence.classes {
Varioous\VaAldivinoteca\Domain\Model\Winevintage {
mapping {
recordType = \Varioous\VaAldivinoteca\Domain\Model\Winevintage
tableName = pages
}
}
}
# map pages and wine
config.tx_extbase {
persistence {
classes {
Varioous\VaAldivinoteca\Domain\Model\Wine {
mapping {
recordType < module.tx_vaaldivinoteca.settings.doktypes.wine
tableName = pages
columns {
crdate.mapOnProperty = crdate
}
}
}
}
}
}
Now I fetch the wine-object ... and it has 3 items in the object storage (see attached image). It should be one (before the update in TYPO3 8 I only got the correct one with the correct language).
Current workaround:
'type' => 'inline',
'foreign_table' => 'pages',
'foreign_field' => 'pid',
'foreign_match_fields' => [
'sys_language_uid' => '###REC_FIELD_sys_language_uid###',
],
Kind regards,
Harald
Files
Updated by Georg Ringer 5 months ago
- Status changed from New to Closed
this is a correct behavior as with 9.0 the table pages_language_overlay
has been migrated into pages
. therefore closing the issue
if you don't agree, feel free to contact me via slack!