From cb141e5a67321715e36755bf59fd797858833cd2 Mon Sep 17 00:00:00 2001 From: skodak Date: Sun, 1 Jun 2008 21:40:56 +0000 Subject: [PATCH] MDL-14679 towards modform conversion - fixed regressions --- course/modedit.php | 5 ++++- mod/resource/mod_form.php | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/course/modedit.php b/course/modedit.php index 106599d9c1..d85035b5fa 100644 --- a/course/modedit.php +++ b/course/modedit.php @@ -92,11 +92,14 @@ 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 diff --git a/mod/resource/mod_form.php b/mod/resource/mod_form.php index 4a17566280..1eedb6a170 100644 --- a/mod/resource/mod_form.php +++ b/mod/resource/mod_form.php @@ -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'); -- 2.39.5