mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: Fixed bug in getCMSFields scaffolding of relations
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@63739 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
ce42fd3f26
commit
09cbef9146
@ -1202,7 +1202,7 @@ class DataObject extends ViewableData implements DataObjectInterface {
|
||||
*/
|
||||
protected function addScaffoldRelationFields($fieldSet) {
|
||||
// make sure we have a tabset
|
||||
if($this->has_many() || $this->many_many()) {
|
||||
if(($this->has_many() || $this->many_many()) && !$fieldSet->fieldByName('Root')) {
|
||||
$oldFields = $fieldSet;
|
||||
$fieldSet = new FieldSet(new TabSet("Root", new Tab("Main")));
|
||||
foreach($oldFields as $field) {
|
||||
@ -1587,7 +1587,7 @@ class DataObject extends ViewableData implements DataObjectInterface {
|
||||
|
||||
// If we don't have an ID, then relation fields don't work
|
||||
if($this->ID) {
|
||||
$this->addScaffoldRelationFields($tabbedFields);
|
||||
$tabbedFields = $this->addScaffoldRelationFields($tabbedFields);
|
||||
}
|
||||
|
||||
$this->extend('updateCMSFields', $tabbedFields);
|
||||
|
Loading…
Reference in New Issue
Block a user