Merge pull request #8870 from jinjie/4

Fix: Allow editing of relation if item is created.
This commit is contained in:
Andre Kiste 2020-05-01 15:37:52 +12:00 committed by GitHub
commit ec51f98adb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -207,7 +207,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)) {