From a535e8547a2365e672eb18b1f4670b8d9d7b8629 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Tue, 26 Sep 2017 19:02:51 +0300 Subject: [PATCH] Fix bug --- .../src/Grav/Framework/Object/Base/ObjectCollectionTrait.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/src/Grav/Framework/Object/Base/ObjectCollectionTrait.php b/system/src/Grav/Framework/Object/Base/ObjectCollectionTrait.php index a122ee3e7e..0a31da39d3 100644 --- a/system/src/Grav/Framework/Object/Base/ObjectCollectionTrait.php +++ b/system/src/Grav/Framework/Object/Base/ObjectCollectionTrait.php @@ -172,9 +172,9 @@ public function collectionGroup($property) foreach ($this->group($property) as $id => $elements) { // TODO: remove when PHP 5.6 is minimum (with doctrine/collections v1.4). if (!method_exists($this, 'createFrom')) { - $collection = new static(array_reverse($this->toArray())); + $collection = new static($elements); } else { - $collection = $this->createFrom(array_reverse($this->toArray())); + $collection = $this->createFrom($elements); } $collections[$id] = $collection;