From 833f0fb261f49122dbc36c6d30d3f582f788e438 Mon Sep 17 00:00:00 2001 From: PMKuipers Date: Mon, 7 Aug 2023 22:20:45 +0200 Subject: [PATCH] Fix for course autosync with the pages change --- classes/studyplan.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/classes/studyplan.php b/classes/studyplan.php index 0caed9c..7deb8fd 100644 --- a/classes/studyplan.php +++ b/classes/studyplan.php @@ -636,7 +636,8 @@ class studyplan { $sql = "SELECT i.course_id FROM {local_treestudyplan} p - INNER JOIN {local_treestudyplan_line} l ON p.id = l.studyplan_id + INNER JOIN {local_treestudyplan_page} pg ON p.id = pg.studyplan_id + INNER JOIN {local_treestudyplan_line} l ON pg.id = l.page_id INNER JOIN {local_treestudyplan_item} i ON l.id = i.line_id WHERE p.id = :studyplan_id AND i.type = :itemtype"; $fields = $DB->get_fieldset_sql($sql,["studyplan_id" => $this->id,"itemtype" => studyitem::COURSE]);