Fixed merge regression

This commit is contained in:
Ingo Schommer 2016-03-07 10:17:15 +13:00
parent 3b11d73c46
commit 627fbf9051

View File

@ -375,6 +375,14 @@ class GridFieldDetailForm_ItemRequest extends RequestHandler {
// Build actions
$actions = $this->getFormActions();
// If we are creating a new record in a has-many list, then
// pre-populate the record's foreign key.
if($list instanceof HasManyList && !$this->record->isInDB()) {
$key = $list->getForeignKey();
$id = $list->getForeignID();
$this->record->$key = $id;
}
$fields = $this->component->getFields();
if(!$fields) $fields = $this->record->getCMSFields();