Skip to content
This repository
Browse code

ENHANCEMENT GridFieldExportButton now supports dot syntax for column …

…sources through DataObject::relField()
  • Loading branch information...
commit 4bcd44aee6f09f4efd0ad6de9aa37466e96d3894 1 parent 92b6adf
Sean Harvey authored March 25, 2012

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. 4  forms/gridfield/GridFieldExportButton.php
4  forms/gridfield/GridFieldExportButton.php
@@ -113,7 +113,7 @@ function generateExportFileData($gridField) {
113 113
 		foreach($items as $item) {
114 114
 			$columnData = array();
115 115
 			foreach($csvColumns as $columnSource => $columnHeader) {
116  
-				$value = $item->$columnSource;
  116
+				$value = $item->relField($columnSource);
117 117
 				$value = str_replace(array("\r", "\n"), "\n", $value);
118 118
 				$columnData[] = '"' . str_replace('"', '\"', $value) . '"';
119 119
 			}
@@ -172,4 +172,4 @@ function setCsvHasHeader($bool) {
172 172
 	}
173 173
 
174 174
 
175  
-}
  175
+}

0 notes on commit 4bcd44a

Please sign in to comment.
Something went wrong with that request. Please try again.