mirror of
https://github.com/symbiote/silverstripe-gridfieldextensions.git
synced 2024-10-22 17:05:39 +02:00
Merge pull request #313 from creative-commoners/pulls/3.2/column-content-fallback
FIX Reinstate previous field fetch logic as fallback
This commit is contained in:
commit
c77d9d1de3
@ -84,6 +84,12 @@ class GridFieldEditableColumns extends GridFieldDataColumns implements
|
||||
$value = $grid->getDataFieldValue($record, $col);
|
||||
$field = $fields->dataFieldByName($col);
|
||||
|
||||
// Fall back to previous logic
|
||||
if (!$field) {
|
||||
$rel = (strpos($col, '.') === false); // field references a relation value
|
||||
$field = ($rel) ? clone $fields->fieldByName($col) : new ReadonlyField($col);
|
||||
}
|
||||
|
||||
if (!$field) {
|
||||
throw new Exception("Could not find the field '$col'");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user