TaxonomyField was running Update when it should not (#7877)

This commit is contained in:
Matteo Piovanelli
2017-10-12 21:21:40 +02:00
committed by Sébastien Ros
parent 521087d489
commit d6fa50aaee

View File

@@ -98,11 +98,11 @@ namespace Orchard.Taxonomies.Handlers {
protected override void UpdateEditorShape(UpdateEditorContext context) {
// case contentitem without localization and taxonomyfield localized
if (context.ContentItem.As<LocalizationPart>() != null) {
if (context.ContentItem.As<LocalizationPart>() == null) {
return;
}
var partFieldDefinitions = context.ContentItem.Parts.SelectMany(p => p.PartDefinition.Fields).Where(x => x.FieldDefinition.Name == "TaxonomyField");
if (partFieldDefinitions == null) {
if (partFieldDefinitions == null || !partFieldDefinitions.Any()) {
return;
}
base.UpdateEditorShape(context);
@@ -134,4 +134,4 @@ namespace Orchard.Taxonomies.Handlers {
}
}
}
}
}