[BUGFIX] Add extension suggestions to EXT:form 07/59807/3
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Tue, 26 Feb 2019 09:21:24 +0000 (10:21 +0100)
committerRalf Zimmermann <ralf.zimmermann@tritum.de>
Wed, 24 Apr 2019 20:20:08 +0000 (22:20 +0200)
EXT:form adds a ContextMenu provider which depends on classes of
EXT:filelist. As EXT:filelist is optional in Composer mode, add the
extension as a suggestion and register the ContextMenu provider only in
case the extension is loaded.

Similar guards are added for hooks of EXT:filelist and EXT:impexp.

Resolves: #87785
Releases: master, 9.5
Change-Id: I254137bc85c87c3d2b6571e32676e7a579f342a9
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/59807
Tested-by: Björn Jacob <bjoern.jacob@tritum.de>
Tested-by: Susanne Moog <look@susi.dev>
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Ralf Zimmermann <ralf.zimmermann@tritum.de>
Reviewed-by: Björn Jacob <bjoern.jacob@tritum.de>
Reviewed-by: Susanne Moog <look@susi.dev>
Reviewed-by: Ralf Zimmermann <ralf.zimmermann@tritum.de>
typo3/sysext/form/composer.json
typo3/sysext/form/ext_emconf.php
typo3/sysext/form/ext_localconf.php

index d5bbaac..faade76 100644 (file)
                "symfony/expression-language": "^4.1",
                "typo3/cms-core": "10.0.*@dev"
        },
+       "suggest": {
+               "typo3/cms-filelist": "Listing of files in the directory",
+               "typo3/cms-impexp": "Import and Export of records from TYPO3 in a custom serialized format (.T3D) for data exchange with other TYPO3 systems."
+       },
        "conflict": {
                "typo3/cms": "*"
        },
index e5efc98..75e1db1 100644 (file)
@@ -15,6 +15,9 @@ $EM_CONF[$_EXTKEY] = [
             'typo3' => '10.0.0',
         ],
         'conflicts' => [],
-        'suggests' => [],
+        'suggests' => [
+            'filelist' => '10.0.0',
+            'impexp' => '10.0.0',
+        ],
     ],
 ];
index 706d3c6..448fb64 100644 (file)
@@ -6,16 +6,20 @@ call_user_func(function () {
     $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['formFileExtension']
         = \TYPO3\CMS\Form\Hooks\FormFileExtensionUpdate::class;
 
-    // Context menu item handling for form files
-    $GLOBALS['TYPO3_CONF_VARS']['BE']['ContextMenu']['ItemProviders'][1530637161]
-        = \TYPO3\CMS\Form\Hooks\FormFileProvider::class;
-
-    $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/impexp/class.tx_impexp.php']['before_addSysFileRecord'][1530637161]
-        = \TYPO3\CMS\Form\Hooks\ImportExportHook::class . '->beforeAddSysFileRecordOnImport';
+    if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('filelist')) {
+        // Context menu item handling for form files
+        $GLOBALS['TYPO3_CONF_VARS']['BE']['ContextMenu']['ItemProviders'][1530637161]
+            = \TYPO3\CMS\Form\Hooks\FormFileProvider::class;
+
+        // File list edit icons
+        $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['fileList']['editIconsHook'][1530637161]
+            = \TYPO3\CMS\Form\Hooks\FileListEditIconsHook::class;
+    }
 
-    // File list edit icons
-    $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['fileList']['editIconsHook'][1530637161]
-        = \TYPO3\CMS\Form\Hooks\FileListEditIconsHook::class;
+    if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('impexp')) {
+        $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/impexp/class.tx_impexp.php']['before_addSysFileRecord'][1530637161]
+            = \TYPO3\CMS\Form\Hooks\ImportExportHook::class . '->beforeAddSysFileRecordOnImport';
+    }
 
     // Hook to enrich tt_content form flex element with finisher settings and form list drop down
     $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][\TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools::class]['flexParsing'][