mirror of
https://github.com/symbiote/silverstripe-gridfieldextensions.git
synced 2024-10-22 17:05:39 +02:00
FIX: Fixed handling of uneditable records in GridFieldEditableColumns
Fixes #312
This commit is contained in:
parent
c77d9d1de3
commit
08f89ea4b5
@ -56,10 +56,6 @@ class GridFieldEditableColumns extends GridFieldDataColumns implements
|
||||
|
||||
public function getColumnContent($grid, $record, $col)
|
||||
{
|
||||
if (!$record->canEdit()) {
|
||||
return parent::getColumnContent($grid, $record, $col);
|
||||
}
|
||||
|
||||
$fields = $this->getForm($grid, $record)->Fields();
|
||||
|
||||
if (!$this->displayFields) {
|
||||
@ -104,6 +100,10 @@ class GridFieldEditableColumns extends GridFieldDataColumns implements
|
||||
$field->setName($this->getFieldName($field->getName(), $grid, $record));
|
||||
$field->setValue($value);
|
||||
|
||||
if (!$record->canEdit()) {
|
||||
$field = $field->performReadonlyTransformation();
|
||||
}
|
||||
|
||||
if ($field instanceof HtmlEditorField) {
|
||||
return $field->FieldHolder();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user