BUGFIX Fixed GridField->setFieldFormatting()

This commit is contained in:
Ingo Schommer 2012-01-09 11:36:50 +01:00
parent 8a8f741584
commit d4bde47944

View File

@ -31,8 +31,8 @@ class GridFieldDefaultColumns implements GridField_ColumnProvider {
// This supports simple FieldName syntax // This supports simple FieldName syntax
if(strpos($fieldName, '.') === false) { if(strpos($fieldName, '.') === false) {
return ($item->XML_val($fieldName) && $xmlSafe) ? $item->XML_val($fieldName) : $item->RAW_val($fieldName); $value = ($item->XML_val($fieldName) && $xmlSafe) ? $item->XML_val($fieldName) : $item->RAW_val($fieldName);
} } else {
$fieldNameParts = explode('.', $fieldName); $fieldNameParts = explode('.', $fieldName);
$tmpItem = $item; $tmpItem = $item;
for($idx = 0; $idx < sizeof($fieldNameParts); $idx++) { for($idx = 0; $idx < sizeof($fieldNameParts); $idx++) {
@ -40,7 +40,7 @@ class GridFieldDefaultColumns implements GridField_ColumnProvider {
// Last value for value // Last value for value
if($idx == sizeof($fieldNameParts) - 1) { if($idx == sizeof($fieldNameParts) - 1) {
if($tmpItem) { if($tmpItem) {
return ($tmpItem->XML_val($relationMethod) && $xmlSafe) ? $tmpItem->XML_val($relationMethod) : $tmpItem->RAW_val($relationMethod); $value = ($tmpItem->XML_val($relationMethod) && $xmlSafe) ? $tmpItem->XML_val($relationMethod) : $tmpItem->RAW_val($relationMethod);
} }
// else get the object for the next iteration // else get the object for the next iteration
} else { } else {
@ -49,6 +49,7 @@ class GridFieldDefaultColumns implements GridField_ColumnProvider {
} }
} }
} }
}
$value = $this->castValue($gridField, $column, $value); $value = $this->castValue($gridField, $column, $value);
$value = $this->formatValue($gridField, $item, $column, $value); $value = $this->formatValue($gridField, $item, $column, $value);