From a9004b9978580ffb6c390361239ae74cfa47a973 Mon Sep 17 00:00:00 2001 From: Mateusz Uzdowski Date: Thu, 6 Dec 2012 16:34:48 +1300 Subject: [PATCH] Restore numbering to navigator items so we can use iterator. Otherwise the numbering is by priority which is not traversable (1000, 2000, 3000...). --- code/controllers/SilverStripeNavigator.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/controllers/SilverStripeNavigator.php b/code/controllers/SilverStripeNavigator.php index d82ec111..c90f2449 100644 --- a/code/controllers/SilverStripeNavigator.php +++ b/code/controllers/SilverStripeNavigator.php @@ -59,7 +59,8 @@ class SilverStripeNavigator extends ViewableData { } 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)); } /**