diff --git a/module/schools/src/Service/SoftwareService.php b/module/schools/src/Service/SoftwareService.php index 62fa12108a2214b468ea98b9cc384c5d51db452c..e0b9185a13c65e4002a58e003e3fd54fd627ffae 100644 --- a/module/schools/src/Service/SoftwareService.php +++ b/module/schools/src/Service/SoftwareService.php @@ -55,12 +55,16 @@ class SoftwareService implements SoftwareServiceInterface if (!$software->id) { throw new \InvalidArgumentException('No software found'); } - $this->persistSoftware($software, $id); + $this->persistSoftware($software, $data); return $software->export(); } private function persistSoftware($software, array $data) { + if (!$data['lab_id']){ + $data['lab_id'] = NULL; + } + $software->softwarecategory_id = $data['softwarecategory']; $software->school_id = $data['school_id']; $software->lab_id = $data['lab_id'];