[FEATURE] Add form configuration to configuration module 16/62816/3
authorChris Müller <typo3@krue.ml>
Fri, 3 Jan 2020 20:11:07 +0000 (21:11 +0100)
committerSusanne Moog <look@susi.dev>
Thu, 16 Jan 2020 10:17:07 +0000 (11:17 +0100)
The debugging of the yaml configuration of the form extension can be
hard. To ease this task the configuration is available in the
configuration module of the lowlevel extension.

Resolves: #90052
Releases: master
Change-Id: I0bfbae26d2f84f4e90766b9dab6e609f029e9c69
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62816
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Guido Schmechel <guido.schmechel@brandung.de>
Tested-by: Steffen Frese <steffenf14@gmail.com>
Tested-by: Susanne Moog <look@susi.dev>
Reviewed-by: Guido Schmechel <guido.schmechel@brandung.de>
Reviewed-by: Benni Mack <benni@typo3.org>
Reviewed-by: Steffen Frese <steffenf14@gmail.com>
Reviewed-by: Susanne Moog <look@susi.dev>
typo3/sysext/core/Documentation/Changelog/master/Feature-90052-AddYamlConfigurationToConfigurationModule.rst [new file with mode: 0644]
typo3/sysext/form/Documentation/I/Concepts/Configuration/Index.rst
typo3/sysext/lowlevel/Classes/Controller/ConfigurationController.php
typo3/sysext/lowlevel/Resources/Private/Language/locallang.xlf

diff --git a/typo3/sysext/core/Documentation/Changelog/master/Feature-90052-AddYamlConfigurationToConfigurationModule.rst b/typo3/sysext/core/Documentation/Changelog/master/Feature-90052-AddYamlConfigurationToConfigurationModule.rst
new file mode 100644 (file)
index 0000000..284ebfc
--- /dev/null
@@ -0,0 +1,18 @@
+.. include:: ../../Includes.txt
+
+===========================================================================
+Feature: #90052 - Form YAML configuration available in configuration module
+===========================================================================
+
+See :issue:`90052`
+
+Description
+===========
+
+If the Form system extension is installed, a new entry
+:guilabel:`Form: YAML Configuration` is available in the menu of the
+:guilabel:`SYSTEM > Configuration` module of the lowlevel system extension.
+When selected, the parsed YAML configuration of the form setup is displayed.
+
+.. index:: Backend, ext:lowlevel, ext:form
+
index 1bd20b8..01d9ad0 100644 (file)
@@ -63,6 +63,13 @@ module.
    This will make your life easier if you want to customize EXT:form
    heavily in order to suit the customer's needs.
 
+.. tip::
+
+   For debugging purposes or for getting an overview about the available
+   configuration use the :guilabel:`SYSTEM > Configuration` module. Select in
+   the menu the :guilabel:`Form: YAML Configuration` item to display the
+   parsed YAML form setup. If the module is not available install the lowlevel
+   system extension.
 
 .. _concepts-configuration-yamlregistration-frontend:
 
index 4c71702..1de45c7 100644 (file)
@@ -26,8 +26,12 @@ use TYPO3\CMS\Core\EventDispatcher\ListenerProvider;
 use TYPO3\CMS\Core\Http\HtmlResponse;
 use TYPO3\CMS\Core\Localization\LanguageService;
 use TYPO3\CMS\Core\Utility\ArrayUtility;
+use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\CMS\Extbase\Object\ObjectManager;
 use TYPO3\CMS\Fluid\View\StandaloneView;
+use TYPO3\CMS\Form\Mvc\Configuration\ConfigurationManager;
+use TYPO3\CMS\Form\Mvc\Configuration\ConfigurationManagerInterface;
 use TYPO3\CMS\Lowlevel\Utility\ArrayBrowser;
 
 /**
@@ -169,6 +173,13 @@ class ConfigurationController
      */
     public function mainAction(ServerRequestInterface $request): ResponseInterface
     {
+        if (ExtensionManagementUtility::isLoaded('form')) {
+            $this->treeSetup['formYamlConfiguration'] = [
+                'label' => 'formYamlConfiguration',
+                'type' => 'formYamlConfiguration',
+            ];
+        }
+
         $backendUser = $this->getBackendUser();
         $languageService = $this->getLanguageService();
 
@@ -245,6 +256,9 @@ class ConfigurationController
             $sortKeysByName = false;
             $listenerProvider = $this->container->get(ListenerProvider::class);
             $renderArray = $listenerProvider->getAllListenerDefinitions();
+        } elseif ($selectedTreeDetails['type'] === 'formYamlConfiguration') {
+            $formConfigurationManager = GeneralUtility::makeInstance(ObjectManager::class)->get(ConfigurationManager::class);
+            $renderArray = $formConfigurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_YAML_SETTINGS, 'form');
         } else {
             throw new \RuntimeException('Unknown array type "' . $selectedTreeDetails['type'] . '"', 1507845662);
         }
index cfcee2b..95161e6 100644 (file)
@@ -39,6 +39,9 @@
                        <trans-unit id="eventListeners" resname="eventListeners">
                                <source>Event Listeners (PSR-14)</source>
                        </trans-unit>
+                       <trans-unit id="formYamlConfiguration" resname="formYamlConfiguration">
+                               <source>Form: YAML Configuration</source>
+                       </trans-unit>
                        <trans-unit id="t3services" resname="t3services">
                                <source>$GLOBALS['T3_SERVICES'] (Registered Services)</source>
                        </trans-unit>