Skip to content

Commit

Permalink
MDL-23561 Fixed support for addHelpButton() in repeated elements
Browse files Browse the repository at this point in the history
  • Loading branch information
mudrd8mz committed Jul 29, 2010
1 parent 80f58e8 commit cd18808
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/formslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,8 @@ function repeat_elements($elementobjs, $repeats, $options, $repeathiddenname,
$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){
Expand Down
3 changes: 1 addition & 2 deletions mod/choice/mod_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ function definition() {
$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);
Expand Down

0 comments on commit cd18808

Please sign in to comment.