Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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).
  • Loading branch information...
commit 02332da7fb20026baac7f54dc12db8f08cc0c188 1 parent 88582e7
@chillu chillu authored
Showing with 7 additions and 1 deletion.
  1. +7 −1 forms/gridfield/GridField.php
View
8 forms/gridfield/GridField.php
@@ -438,7 +438,13 @@ public function getDataFieldValue($record, $fieldName) {
}
// 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;
+ }
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.