mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-70920 backup: call_user_func_array can accept named arguments
Because arguments names do not match in associative array, we change it to regular array or arguments
This commit is contained in:
parent
a93828a188
commit
7b003c04a8
@ -207,7 +207,8 @@ abstract class base_moodleform extends moodleform {
|
||||
$this->add_html_formatting($setting);
|
||||
|
||||
// Then call the add method with the get_element_properties array.
|
||||
call_user_func_array(array($this->_form, 'addElement'), $setting->get_ui()->get_element_properties($task, $OUTPUT));
|
||||
call_user_func_array(array($this->_form, 'addElement'),
|
||||
array_values($setting->get_ui()->get_element_properties($task, $OUTPUT)));
|
||||
$this->_form->setType($setting->get_ui_name(), $setting->get_param_validation());
|
||||
$defaults[$setting->get_ui_name()] = $setting->get_value();
|
||||
if ($setting->has_help()) {
|
||||
@ -335,7 +336,7 @@ abstract class base_moodleform extends moodleform {
|
||||
$mform = $this->_form;
|
||||
// Apply all dependencies for backup.
|
||||
foreach ($setting->get_my_dependency_properties() as $key => $dependency) {
|
||||
call_user_func_array(array($this->_form, 'disabledIf'), $dependency);
|
||||
call_user_func_array(array($this->_form, 'disabledIf'), array_values($dependency));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user