Bug 801 reopened. Problem occur when adding a new activity to a hidden

section, it's visibility defaults to 1.
Now, default visibility is "inherited" from the section visibility.
This commit is contained in:
stronk7 2003-09-30 12:28:22 +00:00
parent 866d33df9b
commit 5e0f9e613a

View File

@ -84,6 +84,13 @@
if (! $sectionid = add_mod_to_section($mod) ) {
error("Could not add the new course module to that section");
}
//We get the section's visible field status
$visible = get_field("course_sections","visible","id",$sectionid);
if (! set_field("course_modules", "visible", $visible, "id", $mod->coursemodule)) {
error("Could not update the course module with the correct visibility");
}
if (! set_field("course_modules", "section", $sectionid, "id", $mod->coursemodule)) {
error("Could not update the course module with the correct section");
}