From 306350d71041bcb7c5893bd9f0a7af751f37f901 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Mon, 3 Feb 2014 15:42:51 +0100 Subject: [PATCH] Fixing query see BT#7386 --- main/gradebook/lib/be/abstractlink.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main/gradebook/lib/be/abstractlink.class.php b/main/gradebook/lib/be/abstractlink.class.php index 32770fa8f5..c56e53e801 100644 --- a/main/gradebook/lib/be/abstractlink.class.php +++ b/main/gradebook/lib/be/abstractlink.class.php @@ -256,7 +256,12 @@ abstract class AbstractLink implements GradebookItem $this->add_linked_data(); if (isset($this->type) && isset($this->ref_id) && isset($this->user_id) && isset($this->course_code) && isset($this->category) && isset($this->weight) && isset($this->visible)) { $tbl_grade_links = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_LINK); - $sql = "SELECT count(*) FROM ".$tbl_grade_links." WHERE ref_id=".$this->get_ref_id()." AND category_id = ".$this->category." AND type = ".$this->type." "; + $sql = "SELECT count(*) FROM ".$tbl_grade_links." + WHERE + ref_id=".$this->get_ref_id()." AND + category_id = ".$this->category." AND + course_code = '".$this->course_code."' AND + type = ".$this->type." "; $result = Database::query($sql); $row_testing = Database::fetch_array($result);