Skip to content

Commit

Permalink
MDL-15372 fixed incorrect merging to HEAD causing fatal errors, becau…
Browse files Browse the repository at this point in the history
…se new dml api was not used
  • Loading branch information
skodak committed Jun 25, 2008
1 parent ed28ebd commit 511c9eb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions backup/restorelib.php
Expand Up @@ -97,11 +97,11 @@ function restore_decode_content_links($restore) {
if (!defined('RESTORE_SILENTLY')) {
echo '<li>' . 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;
}
}
Expand All @@ -110,16 +110,16 @@ function restore_decode_content_links($restore) {
}

// 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 '<li>' . get_string('from') . ' ' . get_string('sections');
}
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;
}
}
Expand Down

0 comments on commit 511c9eb

Please sign in to comment.