Important-67401-DependencyInjectionIsNowDoneBeforeInitializeObject.rst 988 Bytes
Newer Older
1
2
3
4
5
6
7
==============================================================================
Important: #67401 - Dependency Injection is now done before initializeObject()
==============================================================================

Description
===========

8
Formerly ``initializeObject()`` was called before the dependencies were injected when retrieving an Extbase Domain Model. This behavior didn't match the documentation_ nor the behavior when using the ``ObjectManager``.
9

10
With TYPO3 CMS 7.3 this has been changed, dependency injection using ``@inject`` annotations and ``inject*()`` methods is now performed **before** calling ``initializeObject()`` when retrieving Domain Models.
11
12
13
14

This may have impact on extensions that are relying on the reversed call order. In these cases adjustments are required to take into account that the injected objects are available.

.. _documentation: http://wiki.typo3.org/Dependency_Injection#initializeObject.28.29_as_object_lifecycle_method