Improve fix for #1516 about deleting courses with skills assigned

pull/2487/head
Yannick Warnier 9 years ago
parent 18e2e741bd
commit 9bfffa048f
  1. 4
      main/inc/lib/course.lib.php

@ -2333,7 +2333,9 @@ class CourseManager
// Skills
$table = Database::get_main_table(TABLE_MAIN_SKILL_REL_USER);
$sql = "DELETE FROM $table WHERE course_id = $courseId";
$argumentation = Database::escape_string(sprintf(get_lang('SkillFromCourseXDeletedSinceThen'), $course['code']));
error_log($argumentation);
$sql = "UPDATE $table SET course_id = NULL, session_id = NULL, argumentation = '$argumentation' WHERE course_id = $courseId";
Database::query($sql);
// Delete the course from the database

Loading…
Cancel
Save