diff --git a/application/WorkorderBase/WorkorderBaseController.php b/application/WorkorderBase/WorkorderBaseController.php index 1811b6d1d..a5f203b85 100644 --- a/application/WorkorderBase/WorkorderBaseController.php +++ b/application/WorkorderBase/WorkorderBaseController.php @@ -173,15 +173,16 @@ foreach ($newPreorders as $preorder) { if ($existingWorkorder) { if ($existingWorkorder->status === 'archived') { $oldStatus = $existingWorkorder->status; - - WorkorderModel::update($existingWorkorder->id, [ - 'status' => 'new', - 'companyId' => null, - 'civilEngineeringCompanyId' => null, - 'deadlineDate' => null, - 'appointmentDate' => null, - 'clusterId' => $preorder->preordercampaign_id, - ]); + + $new = (array) $existingWorkorder; + + $new['status'] = 'new'; + $new['companyId'] = null; + $new['civilEngineeringCompanyId'] = null; + $new['deadlineDate'] = null; + $new['appointmentDate'] = null; + $new['clusterId'] = $preorder->preordercampaign_id; + WorkorderModel::update($new); WorkorderJournalModel::create([ 'workorderId' => $existingWorkorder->id,