MDL-33875 delete category: fix E_STRICT reset() by ref.
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Wed, 20 Jun 2012 01:31:44 +0000 (03:31 +0200)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Wed, 20 Jun 2012 01:31:44 +0000 (03:31 +0200)
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) {