From 9eb9e1307103e3c758dad58fcf24195c88eba0dc Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Thu, 29 Jun 2017 11:47:42 +1200 Subject: [PATCH] FIX: Re-set finalisedQuery to allow recreation of iterator. --- src/ORM/DataList.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ORM/DataList.php b/src/ORM/DataList.php index 2a3437847..93cf301fb 100644 --- a/src/ORM/DataList.php +++ b/src/ORM/DataList.php @@ -881,6 +881,9 @@ class DataList extends ViewableData implements SS_List, Filterable, Sortable, Li foreach ($this->getFinalisedQuery() as $row) { yield $this->createDataObject($row); } + + // Re-set the finaliseQuery so that it can be re-executed + $this->finalisedQuery = null; } /**