Permalink
Browse files

MDL-31498 formslib: repeat_elements will now set default for group el…

…ements
  • Loading branch information...
1 parent 446dbee commit 3416857d8460381fc8103ed3cae652121b52de67 Rajesh Taneja committed May 2, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/formslib.php
View
@@ -997,8 +997,8 @@ function repeat_elements($elementobjs, $repeats, $options, $repeathiddenname,
foreach ($options as $elementname => $elementoptions){
$pos=strpos($elementname, '[');
if ($pos!==FALSE){
- $realelementname = substr($elementname, 0, $pos+1)."[$i]";
- $realelementname .= substr($elementname, $pos+1);
+ $realelementname = substr($elementname, 0, $pos)."[$i]";
+ $realelementname .= substr($elementname, $pos);
}else {
$realelementname = $elementname."[$i]";
}

0 comments on commit 3416857

Please sign in to comment.