From 511c9eb23b0ffebfa156cfd76f9aa4e4f6c8f18b Mon Sep 17 00:00:00 2001 From: skodak Date: Wed, 25 Jun 2008 07:30:41 +0000 Subject: [PATCH] MDL-15372 fixed incorrect merging to HEAD causing fatal errors, because new dml api was not used --- backup/restorelib.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/backup/restorelib.php b/backup/restorelib.php index 7b585c40ca..8786a6533a 100644 --- a/backup/restorelib.php +++ b/backup/restorelib.php @@ -97,11 +97,11 @@ define('RESTORE_GROUPS_GROUPINGS', 3); if (!defined('RESTORE_SILENTLY')) { echo '
  • ' . get_string('from') . ' ' . get_string('course'); } - $course = get_record('course', 'id', $restore->course_id, '', '', '', '', 'id,summary'); + $course = $DB->get_record('course', array('id'=>$restore->course_id), 'id,summary'); $coursesummary = restore_decode_content_links_worker($course->summary, $restore); if ($coursesummary != $course->summary) { - $course->summary = addslashes($coursesummary); - if (!update_record('course', $course)) { + $course->summary = $coursesummary; + if (!$DB->update_record('course', $course)) { $status = false; } } @@ -110,7 +110,7 @@ define('RESTORE_GROUPS_GROUPINGS', 3); } // Recode links in section summaries. - $sections = get_records('course_sections', 'course', $restore->course_id, 'id', 'id,summary'); + $sections = $DB->get_records('course_sections', array('course'=>$restore->course_id), 'id', 'id,summary'); if ($sections) { if (!defined('RESTORE_SILENTLY')) { echo '
  • ' . get_string('from') . ' ' . get_string('sections'); @@ -118,8 +118,8 @@ define('RESTORE_GROUPS_GROUPINGS', 3); foreach ($sections as $section) { $sectionsummary = restore_decode_content_links_worker($section->summary, $restore); if ($sectionsummary != $section->summary) { - $section->summary = addslashes($sectionsummary); - if (!update_record('course_sections', $section)) { + $section->summary = $sectionsummary; + if (!$DB->update_record('course_sections', $section)) { $status = false; } } -- 2.39.5