diff --git a/EMS/form-bundle/src/Submission/Client.php b/EMS/form-bundle/src/Submission/Client.php index f30ef0251..59b940539 100644 --- a/EMS/form-bundle/src/Submission/Client.php +++ b/EMS/form-bundle/src/Submission/Client.php @@ -34,11 +34,12 @@ public function submit(FormInterface $form, string $ouuid): array $responseCollector = new HandleResponseCollector(); + $formData = new FormData($formConfig, $form); foreach ($formConfig->getSubmissions() as $submissionConfig) { if (!$submissionConfig instanceof SubmissionConfig) { throw new \RuntimeException('Unexpected not loaded submissions'); } - $handleRequest = new HandleRequest($form, $formConfig, $responseCollector, $submissionConfig); + $handleRequest = new HandleRequest($form, $formConfig, $formData, $responseCollector, $submissionConfig); $handler = $this->getHandler($handleRequest); if (null === $handler) { diff --git a/EMS/form-bundle/src/Submission/HandleRequest.php b/EMS/form-bundle/src/Submission/HandleRequest.php index 54b7c91ba..c12445fe5 100644 --- a/EMS/form-bundle/src/Submission/HandleRequest.php +++ b/EMS/form-bundle/src/Submission/HandleRequest.php @@ -10,20 +10,16 @@ final class HandleRequest implements HandleRequestInterface { - private readonly FormData $formData; - private readonly FormConfig $formConfig; - /** * @param FormInterface $form */ public function __construct( private readonly FormInterface $form, - FormConfig $formConfig, + private readonly FormConfig $formConfig, + private readonly FormData $formData, private readonly HandleResponseCollector $responseCollector, private readonly SubmissionConfig $submissionConfig ) { - $this->formData = new FormData($formConfig, $form); - $this->formConfig = $formConfig; } public function addResponse(HandleResponseInterface $response): void