MDL-14679 towards modform conversion - fixed regressions

This commit is contained in:
skodak
2008-06-01 21:40:56 +00:00
parent c18269c7e5
commit cb141e5a67
2 changed files with 5 additions and 2 deletions
+4 -1
View File
@@ -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
+1 -1
View 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');