Browse Source

Use course ID insteado of code - refs BT#9070

Yannick Warnier 10 years ago
parent
commit
dfe2ab4317
1 changed files with 2 additions and 1 deletions
  1. 2 1
      main/admin/course_edit.php

+ 2 - 1
main/admin/course_edit.php

@@ -332,6 +332,7 @@ if ($form->validate()) {
     $subscribe = $course['subscribe'];
     $unsubscribe = $course['unsubscribe'];
     $course['course_code'] = $course_code;
+    $courseId = $course['id'];
 
     if (!stristr($department_url, 'http://')) {
         $department_url = 'http://' . $department_url;
@@ -348,7 +349,7 @@ if ($form->validate()) {
                 visibility = '" . Database::escape_string($visibility) . "',
                 subscribe = '" . Database::escape_string($subscribe) . "',
                 unsubscribe='" . Database::escape_string($unsubscribe) . "'
-            WHERE code='" . Database::escape_string($course_code) . "'";
+            WHERE id = $courseId ";
     Database::query($sql);
 
     // update the extra fields