mirror of
https://github.com/symbiote/silverstripe-gridfieldextensions.git
synced 2024-10-22 17:05:39 +02:00
FIX Reinstate previous field fetch logic as fallback
Fixes some cases where a field is not retrievable via dataFieldByName()
This commit is contained in:
parent
2fc085bbd0
commit
4105d6330f
@ -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