]> git.mjollnir.org Git - moodle.git/commitdiff
Bug 801 reopened. Problem occur when adding a new activity to a hidden
authorstronk7 <stronk7>
Tue, 30 Sep 2003 12:28:22 +0000 (12:28 +0000)
committerstronk7 <stronk7>
Tue, 30 Sep 2003 12:28:22 +0000 (12:28 +0000)
section, it's visibility defaults to 1.
Now, default visibility is "inherited" from the section visibility.

course/mod.php

index 6565cbd26f41c3b2122fda1701e907d86435b7fc..a20d054fb44ac48b8d64d396491cf96cbba8ef7b 100644 (file)
                 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");
                 }