MDL-38713 course: correctly set visibleold on mod creation
Remove uncessary set of visibleold in the form
This commit is contained in:
+1
-1
@@ -412,6 +412,7 @@ if ($mform->is_cancelled()) {
|
||||
$newcm->module = $fromform->module;
|
||||
$newcm->instance = 0; // not known yet, will be updated later (this is similar to restore code)
|
||||
$newcm->visible = $fromform->visible;
|
||||
$newcm->visibleold = $fromform->visible;
|
||||
$newcm->groupmode = $fromform->groupmode;
|
||||
$newcm->groupingid = $fromform->groupingid;
|
||||
$newcm->groupmembersonly = $fromform->groupmembersonly;
|
||||
@@ -481,7 +482,6 @@ if ($mform->is_cancelled()) {
|
||||
// make sure visibility is set correctly (in particular in calendar)
|
||||
// note: allow them to set it even without moodle/course:activityvisibility
|
||||
set_coursemodule_visible($fromform->coursemodule, $fromform->visible);
|
||||
$DB->set_field('course_modules', 'visibleold', 1, array('id' => $fromform->coursemodule));
|
||||
|
||||
if (isset($fromform->cmidnumber)) { //label
|
||||
// set cm idnumber - uniqueness is already verified by form validation
|
||||
|
||||
Reference in New Issue
Block a user