Skip to content

Commit

Permalink
Merge pull request #313 from creative-commoners/pulls/3.2/column-cont…
Browse files Browse the repository at this point in the history
…ent-fallback

FIX Reinstate previous field fetch logic as fallback
  • Loading branch information
Garion Herman authored Jul 30, 2020
2 parents 2fc085b + 4105d63 commit c77d9d1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/GridFieldEditableColumns.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ public function getColumnContent($grid, $record, $col)
$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'");
}
Expand Down

0 comments on commit c77d9d1

Please sign in to comment.