hi,
stumbled about a problem with fieldcasting in the tablelistfield. If i define a field casting for a Date field like this:
$fields['DepartureDate'] = array('title' => 'Departure Date',
'formatting' => '$value',
'casting' => 'Date->Nice');
and there are empty values in the Result of the TableListField´s SourceQuery, the empty values are casted as well which results in wrong dates: " 01/01/1970" .
It seems that the TableListField always tries to "Cast" a fields value even if its value is empty.
TableListField.php
Line: 1357-1362
// casting
if(array_key_exists($fieldName, $this->parent->fieldCasting)) {
$value = $this->parent->getCastedValue($value, $this->parent->fieldCasting[$fieldName]);
} elseif(is_object($value) && method_exists($value, 'Nice')) {
$value = $value->Nice();
}
is there a way to avoid that empty values are casted in the TableListField?
thanks in advance
matze