diff --git a/src/Forms/GridField/GridFieldExportButton.php b/src/Forms/GridField/GridFieldExportButton.php index 9e56b76aa..9fc3ad3f3 100644 --- a/src/Forms/GridField/GridFieldExportButton.php +++ b/src/Forms/GridField/GridFieldExportButton.php @@ -223,10 +223,6 @@ class GridFieldExportButton extends AbstractGridFieldComponent implements GridFi // Remove limit as the list may be paginated, we want the full list for the export $items = $items->limit(null); - // Use Generator in applicable cases to reduce memory consumption - $items = $items instanceof DataList - ? $items->getGenerator() - : $items; /** @var DataObject $item */ foreach ($items as $item) { diff --git a/src/ORM/DataList.php b/src/ORM/DataList.php index e68c42dea..e9f65b04d 100644 --- a/src/ORM/DataList.php +++ b/src/ORM/DataList.php @@ -790,20 +790,6 @@ class DataList extends ViewableData implements SS_List, Filterable, Sortable, Li return $this; } - /** - * Returns a generator for this DataList - * - * @return \Generator&DataObject[] - */ - public function getGenerator() - { - $query = $this->dataQuery->query()->execute(); - - while ($row = $query->record()) { - yield $this->createDataObject($row); - } - } - public function debug() { $val = "

" . static::class . "