From b874d52b7de05420d3297ad1a2cb4c4ffeda88aa Mon Sep 17 00:00:00 2001 From: Georgios Tsakalos Date: Tue, 1 Mar 2016 18:49:00 +0200 Subject: [PATCH] fix bugs in software service --- module/schools/src/Service/SoftwareService.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/module/schools/src/Service/SoftwareService.php b/module/schools/src/Service/SoftwareService.php index 62fa121..e0b9185 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']; -- GitLab