mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX: Fixed recursion bug with FieldSet::fieldPosition
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@66305 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
10c6c394b8
commit
f15cfaccf4
@ -515,11 +515,11 @@ class FieldSet extends DataObjectSet {
|
||||
* @return Position in children collection (first position starts with 0). Returns FALSE if the field can't be found.
|
||||
*/
|
||||
function fieldPosition($field) {
|
||||
if(is_string($field)) $field = $this->fieldByName($field);
|
||||
if(is_object($field)) $field = $field->Name();
|
||||
|
||||
$i = 0;
|
||||
foreach($this->dataFields() as $child) {
|
||||
if($child == $field) return $i;
|
||||
if($child->Name() == $field) return $i;
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user