diff --git a/code/editor/FieldEditor.php b/code/editor/FieldEditor.php index 09969a7..7661fa4 100755 --- a/code/editor/FieldEditor.php +++ b/code/editor/FieldEditor.php @@ -127,10 +127,10 @@ class FieldEditor extends FormField { } // remove the fields not saved - foreach($missingFields as $removedField) { - if(is_numeric($removedField->ID)) { - // check we can edit this - if($this->canEdit()) { + if($this->canEdit()) { + foreach($missingFields as $removedField) { + if(is_numeric($removedField->ID)) { + // check we can edit this $removedField->delete(); } }