From 7b003c04a83a251da4f0beeb287fee2e68f2b23a Mon Sep 17 00:00:00 2001 From: Marina Glancy Date: Tue, 16 Feb 2021 22:52:52 +0100 Subject: [PATCH] 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 --- backup/util/ui/base_moodleform.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backup/util/ui/base_moodleform.class.php b/backup/util/ui/base_moodleform.class.php index 391551622d5..4d2aefb2892 100644 --- a/backup/util/ui/base_moodleform.class.php +++ b/backup/util/ui/base_moodleform.class.php @@ -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)); } }