From 4e32ae08a32612c3af065cf6bb050eae04f58f36 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Thu, 24 Jan 2008 00:12:14 +0000 Subject: [PATCH] Merged revisions 47459 via svnmerge from http://svn.silverstripe.com/open/modules/sapphire/branches/2.2.1asfonz ........ r47459 | jshipman | 2007-12-21 13:56:40 +1300 (Fri, 21 Dec 2007) | 1 line implemented equal values ........ git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@48537 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/DataObjectSet.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/core/model/DataObjectSet.php b/core/model/DataObjectSet.php index 72f1186f7..bec44a5be 100644 --- a/core/model/DataObjectSet.php +++ b/core/model/DataObjectSet.php @@ -849,12 +849,19 @@ class DataObjectSet extends ViewableData implements Iterator { $previous = null; foreach($this->items as $key => $item){ //check if current item field value equals the next - if($item->$field == $previous->$field){ - + if($previous && $item->$field == $previous->$field){ + $item->Ranking = $this->convertIntToRank($count - 1)." equal"; + $previous->Ranking = $this->convertIntToRank($count - 1)." equal"; + if($skipduplicates){ + $count++; } - + + }else{ $item->Ranking = $this->convertIntToRank($count); - $count++; + $count++; + } + + $previous = $item; } } }