Fix: Allow editing of relation if item is created.

This commit is contained in:
Kong Jin Jie 2019-03-20 12:51:49 +08:00
parent 6b450395ce
commit 1d406c64b9

View File

@ -206,7 +206,7 @@ class GridFieldDetailForm_ItemRequest extends RequestHandler
// If we are creating a new record in a has-many list, then
// Disable the form field as it has no effect.
if ($list instanceof HasManyList) {
if ($list instanceof HasManyList && !$this->record->isInDB()) {
$key = $list->getForeignKey();
if ($field = $fields->dataFieldByName($key)) {