From 0f888370be239c914ad1262c7b40a4c9c6825377 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dalibor=20Karlovi=C4=87?= Date: Thu, 11 Aug 2022 15:06:58 +0200 Subject: [PATCH] fix: use executable settings as defaults in form --- src/ProcessManagerBundle/Controller/ExecutableController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ProcessManagerBundle/Controller/ExecutableController.php b/src/ProcessManagerBundle/Controller/ExecutableController.php index 9eef4fb..cbefed5 100644 --- a/src/ProcessManagerBundle/Controller/ExecutableController.php +++ b/src/ProcessManagerBundle/Controller/ExecutableController.php @@ -61,9 +61,10 @@ public function runAction(Request $request): JsonResponse if ($form) { $form = $this->createForm($form); + $form->setData(json_decode($exe->getSettings()['params'] ?? '{}', true)); $startupConfig = $request->get('startupConfig', '{}'); $startupConfig = json_decode($startupConfig, true); - $handledForm = $form->submit($startupConfig); + $handledForm = $form->submit($startupConfig, false); if (!$handledForm->isValid()) { $errors = $this->formErrorSerializer->serializeErrorFromHandledForm($handledForm);