Merge branch 'MDL-33875' of git://github.com/stronk7/moodle
authorDan Poltawski <dan@moodle.com>
Wed, 20 Jun 2012 05:45:49 +0000 (13:45 +0800)
committerDan Poltawski <dan@moodle.com>
Wed, 20 Jun 2012 05:45:49 +0000 (13:45 +0800)
course/delete_category_form.php

index f2d394c..0ceeb8e 100644 (file)
@@ -102,8 +102,10 @@ class delete_category_form extends moodleform {
         /// Give the options for what to do.
             $mform->addElement('select', 'fulldelete', get_string('whattodo'), $options);
             if (count($options) == 1) {
+                $optionkeys = array_keys($options);
+                $option = reset($optionkeys);
                 $mform->hardFreeze('fulldelete');
-                $mform->setConstant('fulldelete', reset(array_keys($options)));
+                $mform->setConstant('fulldelete', $option);
             }
 
             if ($displaylist) {