From c006ae959f213163642631a17458256466fb8a9c Mon Sep 17 00:00:00 2001 From: Georgios Tsakalos Date: Thu, 3 Mar 2016 14:10:15 +0200 Subject: [PATCH] export software bean with categories fix bug in software creation --- module/schools/src/Service/SoftwareService.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/module/schools/src/Service/SoftwareService.php b/module/schools/src/Service/SoftwareService.php index e0b9185..b96f1d3 100644 --- a/module/schools/src/Service/SoftwareService.php +++ b/module/schools/src/Service/SoftwareService.php @@ -65,7 +65,7 @@ class SoftwareService implements SoftwareServiceInterface $data['lab_id'] = NULL; } - $software->softwarecategory_id = $data['softwarecategory']; + $software->softwarecategory_id = $data['softwarecategory_id']; $software->school_id = $data['school_id']; $software->lab_id = $data['lab_id']; $software->title = $data['title']; @@ -103,7 +103,10 @@ class SoftwareService implements SoftwareServiceInterface $exported = []; foreach($beans as $bean) { - $exported[] = $bean->export(); + $cat = $this->getSoftwareCategoryById($bean->id); + $exported_bean = $bean->export(); + $exported_bean['softwarecategory'] = $cat['name']; + $exported[] = $exported_bean; } return $exported; } -- GitLab