Skip to content

Commit

Permalink
MDL-38713 course: correctly set visibleold on mod creation
Browse files Browse the repository at this point in the history
Remove uncessary set of visibleold in the form
  • Loading branch information
danpoltawski committed Mar 26, 2013
1 parent 8bb0c27 commit 642cbee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion course/modedit.php
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,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;
Expand Down Expand Up @@ -481,7 +482,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
Expand Down

0 comments on commit 642cbee

Please sign in to comment.