[TASK] Deprecate AbstractDomainObject::__wakeup and document changes 45/40245/5
authorChristian Kuhn <lolli@schwarzbu.ch>
Mon, 15 Jun 2015 11:31:58 +0000 (13:31 +0200)
committerHelmut Hummel <helmut.hummel@typo3.org>
Mon, 15 Jun 2015 13:29:07 +0000 (15:29 +0200)
Resolves: #67402
Related: #66473
Releases: master
Change-Id: I4a493bd778b2fefdc39fbd7783f406d3fbbebabb
Reviewed-on: http://review.typo3.org/40245
Reviewed-by: Frank Nägler <frank.naegler@typo3.org>
Tested-by: Frank Nägler <frank.naegler@typo3.org>
Reviewed-by: Helmut Hummel <helmut.hummel@typo3.org>
Tested-by: Helmut Hummel <helmut.hummel@typo3.org>
typo3/sysext/core/Documentation/Changelog/master/Breaking-67402-ExtbaseAbstractDomainObjectInitializeObject.rst [new file with mode: 0644]
typo3/sysext/core/Documentation/Changelog/master/Breaking-67402-ExtbaseAbstractDomainObjectWakeUp.rst [new file with mode: 0644]
typo3/sysext/core/Documentation/Changelog/master/Deprecation-67402-ExtbaseAbstractDomainObjectWakeUp.rst [new file with mode: 0644]
typo3/sysext/extbase/Classes/DomainObject/AbstractDomainObject.php

diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-67402-ExtbaseAbstractDomainObjectInitializeObject.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-67402-ExtbaseAbstractDomainObjectInitializeObject.rst
new file mode 100644 (file)
index 0000000..05f2d3a
--- /dev/null
@@ -0,0 +1,27 @@
+================================================================
+Breaking: #67402 - Extbase AbstractDomainObject initializeObject
+================================================================
+
+Description
+===========
+
+Method ``initializeObject()`` has been removed from ``TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject``.
+
+
+Impact
+======
+
+Possible fatal error in Extbase if objects are thawed from persistence.
+
+
+Affected Installations
+======================
+
+Domain objects extending AbstractDomainObject and calling ``parent::initializeObject()``.
+This is relatively unlikely since the default implementation of ``initializeObject()`` is empty.
+
+
+Migration
+=========
+
+Remove calls to ``parent::initializeObject()`` from own ``initializeObject()`` implementations.
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-67402-ExtbaseAbstractDomainObjectWakeUp.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-67402-ExtbaseAbstractDomainObjectWakeUp.rst
new file mode 100644 (file)
index 0000000..5f97b7e
--- /dev/null
@@ -0,0 +1,23 @@
+==========================================================
+Breaking: #67402 - Extbase AbstractDomainObject __wakeup()
+==========================================================
+
+Description
+===========
+
+Method ``__wakeup()`` in classes extending ``TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject``
+is no longer called if objects are created when fetched from persistence.
+
+
+Affected Installations
+======================
+
+An instance is affected if own domain objects extending AbstractDomainObject
+implement own ``__wakeup()`` methods. Those methods are no longer called.
+
+
+Migration
+=========
+
+Move initialization code from ``__wakeup()`` to ``initializeObject()``. As bonus, dependency
+injection was executed at this time already.
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-67402-ExtbaseAbstractDomainObjectWakeUp.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-67402-ExtbaseAbstractDomainObjectWakeUp.rst
new file mode 100644 (file)
index 0000000..46dc5bf
--- /dev/null
@@ -0,0 +1,21 @@
+=============================================================
+Deprecation: #67402 - Extbase AbstractDomainObject __wakeup()
+=============================================================
+
+Description
+===========
+
+Method ``__wakeup()`` has been deprecated in ``TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject``.
+
+
+Affected Installations
+======================
+
+An instance is affected if own domain objects extending AbstractDomainObject
+implement ``__wakeup()`` and call ``parent::__wakeup()`` as documented.
+
+
+Migration
+=========
+
+Remove calls to ``parent::__wakeup()`` from own ``__wakeup()`` implementations.
index 7322d87..07373fd 100644 (file)
@@ -14,6 +14,8 @@ namespace TYPO3\CMS\Extbase\DomainObject;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+
 /**
  * A generic Domain Object.
  *
@@ -64,12 +66,10 @@ abstract class AbstractDomainObject implements DomainObjectInterface, \TYPO3\CMS
         * parent::__wakeup() first!
         *
         * @return void
+        * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8. Objects are instantiated differently calling parent::__wakeup() is no longer necessary.
         */
        public function __wakeup() {
-               $this->initializeObject();
-       }
-
-       public function initializeObject() {
+               GeneralUtility::logDeprecatedFunction();
        }
 
        /**