mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Fixed merge regression
This commit is contained in:
parent
3b11d73c46
commit
627fbf9051
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user