From: stronk7 Date: Tue, 30 Sep 2003 12:28:22 +0000 (+0000) Subject: Bug 801 reopened. Problem occur when adding a new activity to a hidden X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=5e0f9e613a96e58e60a8539c6eeb98a12d664418;p=moodle.git 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. --- diff --git a/course/mod.php b/course/mod.php index 6565cbd26f..a20d054fb4 100644 --- a/course/mod.php +++ b/course/mod.php @@ -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"); }