mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Removing duplicate fields from content parts fails
SingleOrDefault will throw an error when removing fields with the same name. Should be FirstOrDefault as it is on line 64
This commit is contained in:
@@ -43,7 +43,7 @@ namespace Orchard.ContentManagement.MetaData.Builders {
|
||||
}
|
||||
|
||||
public ContentPartDefinitionBuilder RemoveField(string fieldName) {
|
||||
var existingField = _fields.SingleOrDefault(x => x.Name == fieldName);
|
||||
var existingField = _fields.FirstOrDefault(x => x.Name == fieldName);
|
||||
if (existingField != null) {
|
||||
_fields.Remove(existingField);
|
||||
}
|
||||
@@ -162,4 +162,4 @@ namespace Orchard.ContentManagement.MetaData.Builders {
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user