Skip to content
This repository
Browse code

Reformatted GridFieldDataColumns->castValue and added missing assignm…

…ent.
  • Loading branch information...
commit 13bf61d402e4d9ea6d1a3106ff68a8fe0f437a2e 1 parent 9c4e474
jakr authored July 29, 2012

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

  1. 21  forms/gridfield/GridFieldDataColumns.php
21  forms/gridfield/GridFieldDataColumns.php
@@ -212,16 +212,17 @@ protected function castValue($gridField, $fieldName, $value) {
212 212
 		// If a fieldCasting is specified, we assume the result is safe
213 213
 		if(array_key_exists($fieldName, $this->fieldCasting)) {
214 214
 			$value = $gridField->getCastedValue($value, $this->fieldCasting[$fieldName]);
215  
-		}
216  
-		// If the value is an object, we do one of two things
217  
-		else if(is_object($value)) {
218  
-			// If it has a "Nice" method, call that & make sure the result is safe
219  
-			if (method_exists($value, 'Nice')) Convert::raw2xml($value->Nice());
220  
-			// Otherwise call forTemplate - the result of this should already be safe
221  
-			else $value = $value->forTemplate();
222  
-		}
223  
-		// Otherwise, just treat as a text string & make sure the result is safe
224  
-		else {
  215
+		} else if(is_object($value)) {
  216
+			// If the value is an object, we do one of two things
  217
+			if (method_exists($value, 'Nice')) {
  218
+				// If it has a "Nice" method, call that & make sure the result is safe
  219
+				$value = Convert::raw2xml($value->Nice());
  220
+			} else {
  221
+				// Otherwise call forTemplate - the result of this should already be safe
  222
+				$value = $value->forTemplate();
  223
+			}
  224
+		} else {
  225
+			// Otherwise, just treat as a text string & make sure the result is safe
225 226
 			$value = Convert::raw2xml($value);
226 227
 		}
227 228
 

0 notes on commit 13bf61d

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