mirror of
https://github.com/moodle/moodle.git
synced 2025-01-31 04:33:13 +01:00
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:
parent
866d33df9b
commit
5e0f9e613a
@ -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");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user