[BUGFIX] Add more migration hints for config.tx_extbase.objects 10/58310/5
authorBenjamin Franzke <bfr@qbus.de>
Tue, 18 Sep 2018 06:55:41 +0000 (08:55 +0200)
committerAndreas Fernandez <a.fernandez@scripting-base.de>
Tue, 18 Sep 2018 18:27:24 +0000 (20:27 +0200)
The suggested migration (xclasses) does not work for Models
mapped using the PropertyMapper.
It also fails if additional injections have been configured.
(though that could be fixed using
`GeneralUtility::makeInstance(ObjectManager::class)->get()`)

Change-Id: If22b98526fce575435662e731a4f2efca9a014f3
Releases: master
Resolves: #86290
Related: #86270
Reviewed-on: https://review.typo3.org/58310
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
typo3/sysext/core/Documentation/Changelog/master/Deprecation-86270-ExtbaseXclassViaTypoScriptSettings.rst

index 586f936..0e6258f 100644 (file)
@@ -29,8 +29,20 @@ configuration options are affected.
 Migration
 =========
 
-Use XCLASSes configured through :php:`$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects']` instead.
+Use XCLASSes configured in :file:`ext_localconf.php` using
+:php:`$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects']`.
+
+Register implementations in the Extbase object container instead if you need to override classes
+that are processed by the :php:`PropertyMapper` like domain models or if you rely on additional
+injections:
+
+.. code-block:: php
+
+   GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\Container\Container::class)
+       ->registerImplementation(Base::class, Override::class);
+
 If you conditionally configured :ts:`config.tx_extbase.objects` or
-:ts:`plugin.tx_%plugin%.objects`, then move that conditional logic into the XCLASS itself.
+:ts:`plugin.tx_%plugin%.objects`, then move that conditional logic into the
+overriding class itself.
 
 .. index:: TypoScript, NotScanned, ext:extbase