Szenario:
I have two extensions, which extend ext:news
with some specific fields. Up to TYPO3 9 I had to configure the dependency to the news extension with the following TypoScript configuration:
config.tx_extbase {
persistence {
classes {
GeorgRinger\News\Domain\Model\News {
subclasses {
GeorgRinger\News\Domain\Model\News = Vendor\Extension\Domain\Model\News
}
}
Vendor\Extension\Domain\Model\News {
mapping {
tableName = tx_news_domain_model_news
}
}
}
}
}
The model Vendor\Extension\Domain\Model\News
extends the model of the "base" extension:
class News extends \GeorgRinger\News\Domain\Model\News
In TYPO3 10 the TypoScript configuration was replaced with the following configuration in Configuration/Extbase/Persistence/Classes.php
(Breaking: #87623):
\Vendor\Extension\Domain\Model\News::class => [
'tableName' => 'tx_news_domain_model_news',
'recordType' => 0,
],
This works as long, as you have just one extension which extends the news extension. If you have a second extension and enable the TYPO3 cache you will get an error, that the fields which are added in the first extension are not available in the templates of the news extension. The strange part is, that this problem only occurs, when enabling the cache!
So my question is: What is the right way to add some fields to an existing extension in TYPO3 10?