Restore numbering to navigator items so we can use iterator.

Otherwise the numbering is by priority which is not traversable
(1000, 2000, 3000...).
This commit is contained in:
Mateusz Uzdowski 2012-12-06 16:34:48 +13:00 committed by Ingo Schommer
parent 35cbe28188
commit a9004b9978

View File

@ -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));
}
/**