mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 15:05:42 +00:00
MINOR: optimized code when deleting multiple fields
This commit is contained in:
parent
d60a118083
commit
7d39887df3
@ -127,10 +127,10 @@ class FieldEditor extends FormField {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// remove the fields not saved
|
// remove the fields not saved
|
||||||
foreach($missingFields as $removedField) {
|
if($this->canEdit()) {
|
||||||
if(is_numeric($removedField->ID)) {
|
foreach($missingFields as $removedField) {
|
||||||
// check we can edit this
|
if(is_numeric($removedField->ID)) {
|
||||||
if($this->canEdit()) {
|
// check we can edit this
|
||||||
$removedField->delete();
|
$removedField->delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user