MDL-14346 database preset throws Fatal error
This commit is contained in:
@@ -1890,6 +1890,9 @@ class PresetImporter {
|
||||
$settings = new StdClass();
|
||||
|
||||
foreach ($settingsarray as $setting => $value) {
|
||||
if (!is_array($value)) {
|
||||
continue;
|
||||
}
|
||||
$settings->$setting = $value[0]['#'];
|
||||
}
|
||||
|
||||
@@ -1897,8 +1900,14 @@ class PresetImporter {
|
||||
$fieldsarray = $parsedxml['preset']['#']['field'];
|
||||
$fields = array();
|
||||
foreach ($fieldsarray as $field) {
|
||||
if (!is_array($field)) {
|
||||
continue;
|
||||
}
|
||||
$f = new StdClass();
|
||||
foreach ($field['#'] as $param => $value) {
|
||||
if (!is_array($value)) {
|
||||
continue;
|
||||
}
|
||||
$f->$param = $value[0]['#'];
|
||||
}
|
||||
$f->dataid = $this->data->id;
|
||||
|
||||
Reference in New Issue
Block a user