Skip to content
Browse files

MDL-38713 course: correctly set visibleold on mod creation

Remove uncessary set of visibleold in the form
1 parent b9ef2c9 commit 85c361d3ea9876ae4a667b5db49b5c292661924b @danpoltawski danpoltawski committed
Showing with 1 addition and 1 deletion.
  1. +1 −1 course/modedit.php
View
2 course/modedit.php
@@ -413,6 +413,7 @@
$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;
@@ -480,7 +481,6 @@
// 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

0 comments on commit 85c361d

Please sign in to comment.
Something went wrong with that request. Please try again.