mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
#21090 : Do not create duplicate content type when Import/Export data contains taxonomies..
Work Item: 21090
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user