Merge branch 'wip-MDL-45280-master' of git://github.com/marinaglancy/moodle

This commit is contained in:
Sam Hemelryk
2014-04-28 12:22:44 +12:00
+4 -1
View File
@@ -8472,7 +8472,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');
}