]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-14679 towards modform conversion - fixed regressions
authorskodak <skodak>
Sun, 1 Jun 2008 21:40:56 +0000 (21:40 +0000)
committerskodak <skodak>
Sun, 1 Jun 2008 21:40:56 +0000 (21:40 +0000)
course/modedit.php
mod/resource/mod_form.php

index 106599d9c1e92f7165f99cbaa36a601cb4705d0b..d85035b5faf346e34aca7c60da37d076e9b29ab7 100644 (file)
             print_error("moduledoesnotexist");
         }
 
+        if (! $form = get_record($module->name, "id", $cm->instance)) {
+            print_error("moduleinstancedoesnotexist");
+        }
+
         if (! $cw = $DB->get_record("course_sections", array("id"=>$cm->section))) {
             print_error("sectionnotexist");
         }
 
-        $form = clone($cm);
         $form->coursemodule     = $cm->id;
         $form->section          = $cw->section;  // The section number itself - relative!!! (section column in course_sections)
         $form->visible          = $cm->visible; //??  $cw->visible ? $cm->visible : 0; // section hiding overrides
index 4a17566280cbc2e322410868669bbf2ce857fe76..1eedb6a1706b5d43052c26e50a3458fb5eeb01c1 100644 (file)
@@ -10,7 +10,7 @@ class mod_resource_mod_form extends moodleform_mod {
 
         // this hack is needed for different settings of each subtype
         if (!empty($this->_instance)) {
-            if($res = $DB->get_record('resource', array('id'$this->_instance))) {
+            if($res = $DB->get_record('resource', array('id'=>$this->_instance))) {
                 $type = $res->type;
             } else {
                 print_error('incorrect assignment');