MDL-53638 mod_feedback: corrections during rebase:
[moodle.git] / mod / feedback / db / upgradelib.php
index fdad98c..bff4133 100644 (file)
@@ -56,8 +56,9 @@ function mod_feedback_upgrade_courseid($tmp = false) {
     }
 
     // Part 2. Update courseid in the completed table.
     }
 
     // Part 2. Update courseid in the completed table.
-    $sql = "UPDATE {feedback_completed$suffix} "
+    $sql = "UPDATE {feedback_completed$suffix} "
             . "SET courseid = (SELECT COALESCE(MIN(v.course_id), 0) "
             . "SET courseid = (SELECT COALESCE(MIN(v.course_id), 0) "
-            . "FROM {feedback_value$suffix} v WHERE v.completed = c.id)";
+            . "FROM {feedback_value$suffix} v "
+            . "WHERE v.completed = {feedback_completed$suffix}.id)";
     $DB->execute($sql);
 }
     $DB->execute($sql);
 }