#21090 : Do not create duplicate content type when Import/Export data contains taxonomies..

Work Item: 21090
This commit is contained in:
jcastillopino
2015-02-14 15:56:22 +00:00
committed by agriffard
parent d09297b750
commit 952caca41f

View File

@@ -22,17 +22,12 @@ namespace Orchard.Taxonomies.Handlers {
Filters.Add(StorageFilter.For(repository));
OnPublished<TaxonomyPart>((context, part) => {
var previousTermTypeName = part.TermTypeName;
if (previousName == null) {
if (part.TermTypeName == null) {
// is it a new taxonomy ?
taxonomyService.CreateTermContentType(part);
}
else {
// keep the previous term type name as it would otherwise force us
// to update all terms to use another type
part.TermTypeName = previousTermTypeName;
// update existing fields
foreach (var partDefinition in contentDefinitionManager.ListPartDefinitions()) {
foreach (var field in partDefinition.Fields) {