]> git.mjollnir.org Git - moodle.git/commitdiff
fixed problem with applying of default settings during install - choices can not...
authorskodak <skodak>
Thu, 31 Aug 2006 22:17:47 +0000 (22:17 +0000)
committerskodak <skodak>
Thu, 31 Aug 2006 22:17:47 +0000 (22:17 +0000)
admin/adminlib.php

index fb20d8cbd5e64c8c3482aa91bfc7af6e9577adda..7db9e22fefc19cc7c6d80af9475da1b4be980c32 100644 (file)
@@ -634,7 +634,8 @@ class admin_setting_configselect extends admin_setting {
     
     function write_setting($data) {
          // check that what we got was in the original choices
-         if (! in_array($data, array_keys($this->choices))) {
+         // or that the data is the default setting - needed during install when choices can not be constructed yet
+         if ($data != $this->defaultsetting and ! in_array($data, array_keys($this->choices))) {
              return 'Error setting ' . $this->visiblename . '<br />';
          }