MDL-30157 enrol_manual: Setting proper default
authorDavid Monllao <davidm@moodle.com>
Fri, 28 Aug 2015 03:14:55 +0000 (11:14 +0800)
committerDavid Monllao <davidm@moodle.com>
Tue, 15 Sep 2015 08:25:25 +0000 (16:25 +0800)
The wrong default value was working because of count starting from 1.

enrol/manual/yui/quickenrolment/quickenrolment.js

index f3de1bf..e0a62ad 100644 (file)
@@ -215,12 +215,12 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
             var options = this.get(UEP.OPTIONSTARTDATE);
             var index = 0, count = 0;
             for (var i in options) {
-                count++;
                 var option = create('<option value="'+i+'">'+options[i]+'</option>');
                 if (i == defaultvalue) {
                     index = count;
                 }
                 select.append(option);
+                count++;
             }
             select.set('selectedIndex', index);
         },
@@ -608,7 +608,7 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
                 value : 0
             },
             defaultStartDate : {
-                value : 2,
+                value : 3,
                 validator : Y.Lang.isNumber
             },
             defaultDuration : {