From 56e34ee405633cb716764e393ee030341174d11c Mon Sep 17 00:00:00 2001 From: moodler Date: Thu, 21 Aug 2003 15:06:32 +0000 Subject: [PATCH] Fixed bug when moving sections with apostrophes in the summary (bug 641) --- course/lib.php | 7 ++----- course/view.php | 4 +++- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/course/lib.php b/course/lib.php index c75c24ff84..2bcf9b2fa6 100644 --- a/course/lib.php +++ b/course/lib.php @@ -1263,13 +1263,10 @@ function move_section($course, $section, $move) { return false; } - $sectionrecord->section = $sectiondest; - $sectiondestrecord->section = $section; - - if (!update_record("course_sections", $sectionrecord)) { + if (!set_field("course_sections", "section", $sectiondest, "id", $sectionrecord->id)) { return false; } - if (!update_record("course_sections", $sectiondestrecord)) { + if (!set_field("course_sections", "section", $section, "id", $sectiondestrecord->id)) { return false; } return true; diff --git a/course/view.php b/course/view.php index bef7ceb145..0fec158dfe 100644 --- a/course/view.php +++ b/course/view.php @@ -45,7 +45,9 @@ if (!empty($section)) { if (!empty($move)) { - move_section($course, $section, $move); + if (!move_section($course, $section, $move)) { + notify("An error occurred while moving a section"); + } } } } else { -- 2.39.5