mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
API CHANGE Automatically using DBField->Nice() in tabular view of TableListFields (and subclasses like ComplexTableField) instead of using the scalar value. This means for example values casted as Boolean will render as "Yes"/"No" rather than "1"/"0"
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@77549 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
a2a507f73c
commit
90ebeaf741
@ -1267,6 +1267,8 @@ class TableListField_Item extends ViewableData {
|
|||||||
// casting
|
// casting
|
||||||
if(array_key_exists($fieldName, $this->parent->fieldCasting)) {
|
if(array_key_exists($fieldName, $this->parent->fieldCasting)) {
|
||||||
$value = $this->parent->getCastedValue($value, $this->parent->fieldCasting[$fieldName]);
|
$value = $this->parent->getCastedValue($value, $this->parent->fieldCasting[$fieldName]);
|
||||||
|
} elseif(is_object($value) && method_exists($value, 'Nice')) {
|
||||||
|
$value = $value->Nice();
|
||||||
}
|
}
|
||||||
|
|
||||||
// formatting
|
// formatting
|
||||||
|
Loading…
Reference in New Issue
Block a user