FIX Ensure duplicated multiple option field is written (has an ID) before duplicating options

This commit is contained in:
Robbie Averill 2018-03-23 11:53:43 +13:00 committed by Daniel Hensby
parent 3e71cf7840
commit 453a35e114
No known key found for this signature in database
GPG Key ID: D8DEBC4C8E7BC8B9
2 changed files with 2 additions and 1 deletions

View File

@ -225,6 +225,7 @@ class UserFormFieldEditorExtension extends DataExtension
// List of EditableFieldGroups, where the key of the array is the ID of the old end group // List of EditableFieldGroups, where the key of the array is the ID of the old end group
$fieldGroups = []; $fieldGroups = [];
foreach ($oldPage->Fields() as $field) { foreach ($oldPage->Fields() as $field) {
/** @var EditableFormField $newField */
$newField = $field->duplicate(false); $newField = $field->duplicate(false);
$newField->ParentID = $this->owner->ID; $newField->ParentID = $this->owner->ID;
$newField->ParentClass = $this->owner->ClassName; $newField->ParentClass = $this->owner->ClassName;

View File

@ -123,7 +123,7 @@ class EditableMultipleOptionField extends EditableFormField
$manyMany = null; $manyMany = null;
} }
$clonedNode = parent::duplicate($doWrite, $manyMany); $clonedNode = parent::duplicate(true, $manyMany);
foreach ($this->Options() as $field) { foreach ($this->Options() as $field) {
/** @var EditableOption $newField */ /** @var EditableOption $newField */