From 4c6ddcb34acb7d63588838bb2135b95677a2908e Mon Sep 17 00:00:00 2001
From: Ralf Zimmermann <ralf.zimmermann@tritum.de>
Date: Tue, 22 Sep 2015 14:48:05 +0200
Subject: [PATCH] [BUGFIX] EXT:form - check for compatibility6 if old mailform
 is used

Check if compatibility6 is loaded if typoscript
"useDefaultContentObject" is set.

Resolves: #69195
Releases: master
Change-Id: Ie1ae530260d6057904a7ed4be2daf573cb358bd0
Reviewed-on: http://review.typo3.org/43472
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Bjoern Jacob <bjoern.jacob@tritum.de>
Tested-by: Bjoern Jacob <bjoern.jacob@tritum.de>
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Reviewed-by: Michael Oehlhof <typo3@oehlhof.de>
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
---
 typo3/sysext/form/Classes/Hooks/ContentObjectHook.php | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/typo3/sysext/form/Classes/Hooks/ContentObjectHook.php b/typo3/sysext/form/Classes/Hooks/ContentObjectHook.php
index 6b0a3559e59c..8a18b88ed8a9 100644
--- a/typo3/sysext/form/Classes/Hooks/ContentObjectHook.php
+++ b/typo3/sysext/form/Classes/Hooks/ContentObjectHook.php
@@ -19,9 +19,10 @@ use TYPO3\CMS\Core\Utility\ArrayUtility;
 use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
 use TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser;
 use TYPO3\CMS\Form\Domain\Model\Configuration;
+use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
 
 /**
- * The form wizard controller
+ * Hook cObjGetSingleExt
  */
 class ContentObjectHook {
 
@@ -42,7 +43,11 @@ class ContentObjectHook {
 	 */
 	public function cObjGetSingleExt($typoScriptObjectName, array $typoScript, $typoScriptKey, ContentObjectRenderer $contentObject) {
 		$content = '';
-		if ($typoScriptObjectName === 'FORM' && !empty($typoScript['useDefaultContentObject'])) {
+		if (
+			$typoScriptObjectName === 'FORM'
+			&& !empty($typoScript['useDefaultContentObject'])
+			&& ExtensionManagementUtility::isLoaded('compatibility6')
+		) {
 			$content = $contentObject->getContentObject($typoScriptObjectName)->render($typoScript);
 		} elseif ($typoScriptObjectName === 'FORM') {
 			$mergedTypoScript = NULL;
-- 
GitLab