From 77e44366f6236ffef8a7fbafdd4035cf59c7664e Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Wed, 25 Jan 2012 18:56:54 +0100 Subject: [PATCH] Fixing query due the recent changes when adding the c_id --- main/inc/lib/thematic.lib.php | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/main/inc/lib/thematic.lib.php b/main/inc/lib/thematic.lib.php index cf29ae243f..794e4cd855 100644 --- a/main/inc/lib/thematic.lib.php +++ b/main/inc/lib/thematic.lib.php @@ -705,16 +705,9 @@ class Thematic $condition .= " AND description_type = $description_type "; } - $items = $elements_to_show = $elements_to_show_values = array(); - $items_from_course = api_get_item_property_by_tool('thematic_plan', api_get_course_id(), 0); $items_from_session = api_get_item_property_by_tool('thematic_plan', api_get_course_id(), api_get_session_id()); - - $elements_to_show = array(); - foreach($items as $value) { - $elements_to_show[$value['ref']] = $value; - } - $elements_to_show_values = array_keys($elements_to_show); + $thematic_plan_complete_list = array(); $thematic_plan_id_list = array(); @@ -734,8 +727,8 @@ class Thematic } if (!empty($thematic_plan_id_list)) { $sql = "SELECT tp.id, thematic_id, tp.title, description, description_type, t.session_id - FROM $tbl_thematic_plan tp INNER JOIN $tbl_thematic t ON (t.id=tp.thematic_id) - WHERE c_id = $course_id $condition AND tp.id IN (".implode(', ', $thematic_plan_id_list).") "; + FROM $tbl_thematic_plan tp INNER JOIN $tbl_thematic t ON (t.id=tp.thematic_id) + WHERE t.c_id = $course_id AND tp.c_id = $course_id $condition AND tp.id IN (".implode(', ', $thematic_plan_id_list).") "; $rs = Database::query($sql);