MDL-45280 wrtie default value for admin_setting_configstoredfile

this fixes regression from MDL-45134
This commit is contained in:
Marina Glancy
2014-04-26 10:42:41 +08:00
parent 0154a32f73
commit 3e56504a85
+4 -1
View File
@@ -8270,7 +8270,10 @@ class admin_setting_configstoredfile extends admin_setting {
// Let's not deal with validation here, this is for admins only.
$current = $this->get_setting();
if (!is_number($data)) {
if (empty($data) && $current === null) {
// This will be the case when applying default settings (installation).
return ($this->config_write($this->name, '') ? '' : get_string('errorsetting', 'admin'));
} else if (!is_number($data)) {
// Draft item id is expected here!
return get_string('errorsetting', 'admin');
}