#100967Extbase ObjectConverter not aware of xclassed objects
Description
The possibility to extend an Extbase domain model from a 3rd party extension is a major benefit of TYPO3. Back in the v10 and v11, TYPO3\CMS\Extbase\Object\Container\Container:registerImplementation was used to make Extbase aware of overridden classes. With v12, we achieved this by using GeneralUtility::makeInstance() in ObjectConverter::buildObject() when objects are created. This works fine for persisted objects, but not for new objects, which e.g. are about to be created.
When new objects are created, Extbase PropertyMapper will evaluate all child properties of the object. This is however done using the original (not XCLASSed) parameter retrieved from the Extbase argument. So if a domain model has been extended using XCLASS and the PropertyMapper maps properties, it only considers the properties from the original class and throws an exception, when unknown properties are met.
As a conclusion, we should also make the Extbase ObjectConverter (TypeConverter) aware of a potential XCLASSed object.
- Slack Discussion about
registerImplementationremoval in v12: https://typo3.slack.com/archives/C03AM9R17/p1634036547334600