From fa9cbb74ce9b5921a8b92d62edcfa188b42dbe80 Mon Sep 17 00:00:00 2001 From: John Milmine Date: Sat, 21 Feb 2015 23:03:34 +1300 Subject: [PATCH] checking for destroy needed if field is passed array data rather than objects. --- forms/gridfield/GridFieldExportButton.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/forms/gridfield/GridFieldExportButton.php b/forms/gridfield/GridFieldExportButton.php index 7d573a55c..07446a218 100644 --- a/forms/gridfield/GridFieldExportButton.php +++ b/forms/gridfield/GridFieldExportButton.php @@ -155,7 +155,9 @@ class GridFieldExportButton implements GridField_HTMLProvider, GridField_ActionP $fileData .= "\n"; } - $item->destroy(); + if ($item->hasMethod('destroy')) { + $item->destroy(); + } } return $fileData;