mirror of
https://github.com/symbiote/silverstripe-gridfieldextensions.git
synced 2024-10-22 15:05:39 +00:00
support and cast relationship references as ReadonlyField
This commit is contained in:
parent
1a56a467fc
commit
c7fb5a5203
@ -30,7 +30,8 @@ class GridFieldEditableColumns extends GridFieldDataColumns implements
|
||||
|
||||
$fields = $this->getForm($grid, $record)->Fields();
|
||||
$value = $grid->getDataFieldValue($record, $col);
|
||||
$field = clone $fields->fieldByName($col);
|
||||
$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…
x
Reference in New Issue
Block a user