MDL-14679 towards modform conversion - fixed regressions
This commit is contained in:
+4
-1
@@ -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
|
||||
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user