Permalink
Browse files

MDL-39764 course_format: Allow courses to have numsections > maxsecti…

…ons.
  • Loading branch information...
1 parent ee2e56e commit d49e53b39fd36dbc550ce8d9b64ee52e2e2c228e @gjb2048 gjb2048 committed Jun 3, 2013
Showing with 10 additions and 0 deletions.
  1. +10 −0 course/edit_form.php
View
10 course/edit_form.php
@@ -130,6 +130,16 @@ function definition() {
if (!isset($max) || !is_numeric($max)) {
$max = 52;
}
+ /*
+ * Increase the number of sections combo box values if the user has increased the number of sections
+ * using the icon on the course page beyond course 'maxsections' or course 'maxsections' has been
+ * reduced below the number of sections already set for the course on the site administration course
+ * defaults page. This is so that the number of sections is not reduced leaving unintended orphaned
+ * activities / resources.
+ */
+ if (isset($course->numsections) && $course->numsections > $max) {
+ $max = $course->numsections;
+ }
for ($i = 0; $i <= $max; $i++) {
$sectionmenu[$i] = "$i";
}

0 comments on commit d49e53b

Please sign in to comment.