mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02: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
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user