From e91b7be056cb7ad7174def67998668dd4ab450c0 Mon Sep 17 00:00:00 2001 From: Steve Piner Date: Wed, 11 May 2022 08:47:14 +1200 Subject: [PATCH] FIX Use DataColumns content when available in CSV export Fix #9248 broke #9173 by accidentally checking for a string key in a numerically indexed array. Change the check to search the array instead (fixes #10308) --- src/Forms/GridField/GridFieldExportButton.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Forms/GridField/GridFieldExportButton.php b/src/Forms/GridField/GridFieldExportButton.php index 8d5b3b427..de5d523b4 100644 --- a/src/Forms/GridField/GridFieldExportButton.php +++ b/src/Forms/GridField/GridFieldExportButton.php @@ -234,7 +234,7 @@ class GridFieldExportButton implements GridField_HTMLProvider, GridField_ActionP } $value = $columnHeader($relObj); - } elseif ($gridFieldColumnsComponent && array_key_exists($columnSource, $columnsHandled)) { + } elseif ($gridFieldColumnsComponent && in_array($columnSource, $columnsHandled)) { $value = strip_tags( $gridFieldColumnsComponent->getColumnContent($gridField, $item, $columnSource) );