]> git.mjollnir.org Git - moodle.git/commitdiff
Fixed bug when moving sections with apostrophes in the summary (bug 641)
authormoodler <moodler>
Thu, 21 Aug 2003 15:06:32 +0000 (15:06 +0000)
committermoodler <moodler>
Thu, 21 Aug 2003 15:06:32 +0000 (15:06 +0000)
course/lib.php
course/view.php

index c75c24ff8479469d21c6d8de2a9c074f92b18f8c..2bcf9b2fa650d2b550fb16e6589062971c1acbf7 100644 (file)
@@ -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;
index bef7ceb145db844fda92ac4979962d726c38ba82..0fec158dfe2141846f1a3a782e244fc998bd5d16 100644 (file)
@@ -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 {