From a57ee3d884407e65a8877f846ddf1437db184f0e Mon Sep 17 00:00:00 2001 From: PMKuipers Date: Fri, 8 Mar 2024 16:57:34 +0100 Subject: [PATCH] Removed debug statements --- classes/cascadecohortsync.php | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/classes/cascadecohortsync.php b/classes/cascadecohortsync.php index c5a3c47..82d0003 100644 --- a/classes/cascadecohortsync.php +++ b/classes/cascadecohortsync.php @@ -176,8 +176,6 @@ class cascadecohortsync { $lines = $this->studyplan->get_all_studylines(); - debug::write("Starting cohort sync cascading"); - debug::dump($lines); foreach($lines as $line) { $this->syncline($line); @@ -189,20 +187,15 @@ class cascadecohortsync { */ public function syncline(studyline $line){ global $DB; - debug::dump($line->simple_model()); // Find the courses that need to be synced to the associated cohorts. $courseids = $line->get_linked_course_ids(); if ($line->enrollable()) { - debug::write("Checking sycn for enrollable line {$line->name}"); // Since the studyline is enrollable, we need to cascade by student. foreach ($courseids as $courseid) { /* 1: Associate the users by individual association */ $course = \get_course($courseid); - debug::write(" processing course {$course->shortname}"); $userids = $line->get_enrolled_userids(); - debug::write(" Will attempt to enrol the following userids"); - debug::dump($userids); if (count($userids) > 0) { // Get the manual enrol instance for this course. $instanceparams = ['courseid' => $courseid, 'enrol' => 'manual']; @@ -216,8 +209,6 @@ class cascadecohortsync { } } if ($instance !== null) { - debug::write("Got manual enrol instance for this course"); - debug::dump($instance); foreach ($userids as $uid) { // Try a manual registration - it will just be updated if it is already there.... $this->manualenrol->enrol_user($instance, $uid, $this->roleid); @@ -234,10 +225,7 @@ class cascadecohortsync { if (get_config("local_treestudyplan", "csync_autoremove")) { // Only try the autoremove if the option is enabled. - debug::write("Checking for existing cohort syncs"); foreach($this->list_cohortsyncs($courseid) as $instance) { - debug::write("Got existing cohort sync, attempting to remove"); - debug::dump($instance); $this->unlink_cohortsync($instance); }