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.