Browse files

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

…ements
  • Loading branch information...
1 parent aa753ac commit 86b600d67a3c84cc699858ac89a3948fbc43de7a @rajeshtaneja rajeshtaneja committed May 2, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/formslib.php
View
4 lib/formslib.php
@@ -1000,8 +1000,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 86b600d

Please sign in to comment.