]> git.mjollnir.org Git - moodle.git/commitdiff
Fix for bug 1678:
authordefacer <defacer>
Sun, 22 Aug 2004 16:49:40 +0000 (16:49 +0000)
committerdefacer <defacer>
Sun, 22 Aug 2004 16:49:40 +0000 (16:49 +0000)
When a course's format is changed, blocks which are not appropriate for the
new format are automatically purged.

course/edit.php

index 1210f67ace2e7807887df646851f2c0f3f6f553b..a07024645e364371b03f6857c7b8b62dcbfe2507 100644 (file)
             $form->timemodified = time();
 
             if (!empty($course)) {
+                // Test for and remove blocks which aren't appropriate anymore
+                $form->blockinfo = $course->blockinfo;
+                block_remove_inappropriate_from_course($form);
+
+                // Update with the new data
                 if (update_record("course", $form)) {
                     add_to_log($course->id, "course", "update", "edit.php?id=$id", "");
                     fix_course_sortorder();