Permalink
Browse files

Restore numbering to navigator items so we can use iterator.

Otherwise the numbering is by priority which is not traversable
(1000, 2000, 3000...).
  • Loading branch information...
1 parent 35cbe28 commit a9004b9978580ffb6c390361239ae74cfa47a973 @mateusz mateusz committed with chillu Dec 6, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 code/controllers/SilverStripeNavigator.php
View
3 code/controllers/SilverStripeNavigator.php
@@ -59,7 +59,8 @@ public function getItems() {
}
ksort($items);
- return new ArrayList($items);
+ // Drop the keys and let the ArrayList handle the numbering, so $First, $Last and others work properly.
+ return new ArrayList(array_values($items));
}
/**

0 comments on commit a9004b9

Please sign in to comment.