From da75b27a1fc4b6181245ca2b6ab7ddd093bcdf6f Mon Sep 17 00:00:00 2001 From: Marcin Haba Date: Wed, 4 Sep 2024 20:09:59 +0200 Subject: [PATCH] Fix virtualfull job wizard for using existing jobs --- Web/Pages/NewVirtualFullJobWizard.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/Web/Pages/NewVirtualFullJobWizard.php b/Web/Pages/NewVirtualFullJobWizard.php index 80ff9bd..d7bf60c 100644 --- a/Web/Pages/NewVirtualFullJobWizard.php +++ b/Web/Pages/NewVirtualFullJobWizard.php @@ -855,10 +855,20 @@ public function wizardCompleted($sender, $param) 'Job', $job['Name'] ]; - $result = $this->getModule('api')->create( - $params, - ['config' => json_encode($job)] - ); + + $result = (object) ['error' => -1, 'output' => '']; + if ($this->WhatToDoWithVirtualFullNewJob->Checked) { + $result = $this->getModule('api')->create( + $params, + ['config' => json_encode($job)] + ); + } elseif ($this->WhatToDoWithVirtualFullExistingJob->Checked) { + + $result = $this->getModule('api')->set( + $params, + ['config' => json_encode($job)] + ); + } if ($result->error === 0) { $this->getModule('api')->set(['console'], ['reload']); $this->getModule('audit')->audit(