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]);