mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX Don't include has_many/many_many relationships in DataObject->scaffoldFormFields() when the record doesn't have an ID yet - as the scaffolded GridFieldAddExistingAutocompleter component assumes the component has an ID to query against (fixes #5723)
This commit is contained in:
parent
74ea2fab82
commit
687a1ca72b
@ -1859,7 +1859,8 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
|
||||
public function getCMSFields($params = null) {
|
||||
$tabbedFields = $this->scaffoldFormFields(array_merge(
|
||||
array(
|
||||
'includeRelations' => true,
|
||||
// Don't allow has_many/many_many relationship editing before the record is first saved
|
||||
'includeRelations' => ($this->ID > 0),
|
||||
'tabbed' => true,
|
||||
'ajaxSafe' => true
|
||||
),
|
||||
|
Loading…
x
Reference in New Issue
Block a user