diff --git a/Classes/Controller/Dispatcher.php b/Classes/Controller/Dispatcher.php index 2831b537..3e114044 100644 --- a/Classes/Controller/Dispatcher.php +++ b/Classes/Controller/Dispatcher.php @@ -47,7 +47,7 @@ class Dispatcher extends AbstractPlugin */ protected $utilityFuncs; - public function main(): ResponseInterface + public function main(array $settings): ResponseInterface { $this->componentManager = GeneralUtility::makeInstance(Manager::class); $this->globals = GeneralUtility::makeInstance(Globals::class); @@ -87,7 +87,7 @@ public function main(): ResponseInterface $controller->setPredefined($predef); } - $result = $controller->process(); + $result = $controller->process($settings); return $result; } } diff --git a/Classes/Controller/FormController.php b/Classes/Controller/FormController.php index 6765cabd..ff6b56f2 100644 --- a/Classes/Controller/FormController.php +++ b/Classes/Controller/FormController.php @@ -48,6 +48,7 @@ class FormController extends AbstractClass protected ?Configuration $configuration = null; protected ResponseFactory $responseFactory; protected StreamFactory $streamFactory; + protected array $processSettings = []; public function __construct() { @@ -57,8 +58,9 @@ public function __construct() } - public function process(): ResponseInterface + public function process(array $settings): ResponseInterface { + $this->processSettings = $settings; $this->init(); $this->storeFileNamesInGP(); $this->processFileRemoval(); @@ -973,6 +975,7 @@ public function getSettings() unset($settings['predef.']); $settings = $this->utilityFuncs->mergeConfiguration($settings, $predefSettings); } + $settings = $this->utilityFuncs->mergeConfiguration($settings, $this->processSettings); return $settings; } } diff --git a/Classes/Controller/FormhandlerPluginController.php b/Classes/Controller/FormhandlerPluginController.php index 84f5868c..a6304bdb 100644 --- a/Classes/Controller/FormhandlerPluginController.php +++ b/Classes/Controller/FormhandlerPluginController.php @@ -3,6 +3,8 @@ namespace Typoheads\Formhandler\Controller; use Psr\Http\Message\ResponseInterface; +use TYPO3\CMS\Core\TypoScript\TypoScriptService; +use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Mvc\Controller\ActionController; class FormhandlerPluginController extends ActionController @@ -11,7 +13,9 @@ public function indexAction(): ResponseInterface { $dispatcher = new Dispatcher(); $dispatcher->setRequests($this->request); - return $dispatcher->main('', []); + $typoscript = GeneralUtility::makeInstance(TypoScriptService::class); + $settings = $typoscript->convertPlainArrayToTypoScriptArray($this->settings); + return $dispatcher->main($settings); } }