mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR GridField compat with ViewableData records (fixes #7479)
Only use relField() when it exists (usually on DataObject), otherwise fall back to method or value returns (same as original GridFieldDataColumns behaviour).
This commit is contained in:
parent
88582e7483
commit
02332da7fb
@ -438,7 +438,13 @@ class GridField extends FormField {
|
||||
}
|
||||
|
||||
// Default implementation
|
||||
return $record->relField($fieldName);
|
||||
if($record->hasMethod('relField')) {
|
||||
return $record->relField($fieldName);
|
||||
} elseif($record->hasMethod($fieldName)) {
|
||||
return $record->$fieldName();
|
||||
} else {
|
||||
return $record->$fieldName;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user