From 5bbff0799c3a980b84e82eba61dd46aa0988510b Mon Sep 17 00:00:00 2001 From: PMKuipers Date: Fri, 30 Jun 2023 10:54:59 +0200 Subject: [PATCH] Bugfix in cascading cohort sync --- classes/cascadecohortsync.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/cascadecohortsync.php b/classes/cascadecohortsync.php index d10eed7..63792ee 100644 --- a/classes/cascadecohortsync.php +++ b/classes/cascadecohortsync.php @@ -118,7 +118,7 @@ class cascadecohortsync { if(!in_array($this->studyplanid ,$plans)){ // if not, add it to the reference $this->debug->write("Adding this plan to the list"); - $plans[] = $this->studyplanid; + $plans[] = (int)($this->studyplanid); $enrol->update_instance($instance,(object)["customtext4"=>json_encode($plans)]); } @@ -139,7 +139,7 @@ class cascadecohortsync { // in the customtext4 field in json format $this->debug->write("Instance ({$instanceid} created. Updateing instance with studyplan id"); $instance = $DB->get_record('enrol', array('id' => $instanceid)); - $enrol->update_instance($instance,(object)["customtext4"=>json_encode([$this->studyplanid])]); + $enrol->update_instance($instance,(object)["customtext4"=>json_encode([(int)($this->studyplanid)])]); $this->debug->write("Synchronize the enrolment"); // Successfully added a valid new instance, so now instantiate it.