diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-68748-DeprecateAbstractContentObjectgetContentObject.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-68748-DeprecateAbstractContentObjectgetContentObject.rst new file mode 100644 index 0000000000000000000000000000000000000000..669f21b95e1bf270f72babf5de3de0e24c2b3126 --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-68748-DeprecateAbstractContentObjectgetContentObject.rst @@ -0,0 +1,15 @@ +========================================================================= +Deprecation: #68748 - Deprecate AbstractContentObject::getContentObject() +========================================================================= + +Description +=========== + +The method is renamed to getContentObjectRenderer(). The old method name is still present as a +deprecated alias, which will be removed in TYPO3 v10. + + +Impact +====== + +All method calls to getContentObject() must be changed to getContentObjectRenderer() until TYPO3 v9. diff --git a/typo3/sysext/frontend/Classes/ContentObject/AbstractContentObject.php b/typo3/sysext/frontend/Classes/ContentObject/AbstractContentObject.php index 120b2b1a7c9416ddaa535f86170fdbc4de2bef51..4fd1eb9eb1d80d159ab3a0628789288d7d34e2ca 100644 --- a/typo3/sysext/frontend/Classes/ContentObject/AbstractContentObject.php +++ b/typo3/sysext/frontend/Classes/ContentObject/AbstractContentObject.php @@ -51,11 +51,23 @@ abstract class AbstractContentObject abstract public function render($conf = array()); /** - * Getter for current cObj + * Getter for current ContentObjectRenderer * * @return ContentObjectRenderer + * @deprecated since TYPO3 v8, will be removed with TYPO3 v9. Use getContentObjectRenderer() instead. */ public function getContentObject() + { + GeneralUtility::logDeprecatedFunction(); + return $this->getContentObjectRenderer(); + } + + /** + * Getter for current ContentObjectRenderer + * + * @return ContentObjectRenderer + */ + public function getContentObjectRenderer() { return $this->cObj; } diff --git a/typo3/sysext/frontend/Tests/Unit/ContentObject/FluidTemplateContentObjectTest.php b/typo3/sysext/frontend/Tests/Unit/ContentObject/FluidTemplateContentObjectTest.php index c4c3727e8bac2c10a31e1d5a8c98b9407f60b3e3..479a0d877f84f0e024e228e2ccac44b84dbc665e 100644 --- a/typo3/sysext/frontend/Tests/Unit/ContentObject/FluidTemplateContentObjectTest.php +++ b/typo3/sysext/frontend/Tests/Unit/ContentObject/FluidTemplateContentObjectTest.php @@ -99,7 +99,7 @@ class FluidTemplateContentObjectTest extends \TYPO3\CMS\Core\Tests\UnitTestCase */ public function constructSetsContentObjectRenderer() { - $this->assertSame($this->contentObjectRenderer, $this->subject->getContentObject()); + $this->assertSame($this->contentObjectRenderer, $this->subject->getContentObjectRenderer()); } /**