mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
MDL-14346 database preset throws Fatal error; merged from MOODLE_19_STABLE
This commit is contained in:
parent
a1bbd88dd2
commit
02007b01b8
@ -1896,6 +1896,9 @@ class PresetImporter {
|
||||
$settings = new StdClass();
|
||||
|
||||
foreach ($settingsarray as $setting => $value) {
|
||||
if (!is_array($value)) {
|
||||
continue;
|
||||
}
|
||||
$settings->$setting = $value[0]['#'];
|
||||
}
|
||||
|
||||
@ -1903,8 +1906,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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user