From cd188086d349e54fada06764fd095bea76ec60bb Mon Sep 17 00:00:00 2001 From: David Mudrak Date: Thu, 29 Jul 2010 07:54:30 +0000 Subject: [PATCH] MDL-23561 Fixed support for addHelpButton() in repeated elements --- lib/formslib.php | 3 ++- mod/choice/mod_form.php | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/formslib.php b/lib/formslib.php index 09e3d1fe227..b5bf9fc2c47 100644 --- a/lib/formslib.php +++ b/lib/formslib.php @@ -914,7 +914,8 @@ abstract class moodleform { $mform->setDefault($realelementname, $params); break; case 'helpbutton' : - $mform->addHelpButton($realelementname, $params); + $params = array_merge(array($realelementname), $params); + call_user_func_array(array(&$mform, 'addHelpButton'), $params); break; case 'disabledif' : foreach ($namecloned as $num => $name){ diff --git a/mod/choice/mod_form.php b/mod/choice/mod_form.php index 1129ffc6ee1..95a16dde0f3 100644 --- a/mod/choice/mod_form.php +++ b/mod/choice/mod_form.php @@ -51,8 +51,7 @@ class mod_choice_mod_form extends moodleform_mod { $repeateloptions['limit']['disabledif'] = array('limitanswers', 'eq', 0); $mform->setType('limit', PARAM_INT); - //TODO: MDL-23561 temp workaround for fatal errors caused by following line - //$repeateloptions['option']['helpbutton'] = array('choiceoptions', get_string('modulenameplural', 'choice'), 'choice'); + $repeateloptions['option']['helpbutton'] = array('choiceoptions', 'choice'); $mform->setType('option', PARAM_CLEAN); $mform->setType('optionid', PARAM_INT);