Taxonomies: Fixing that TaxonomiesLocalizationExtensions caused Terms to be saved as Draft when changing their Weight, fixes #8273

This commit is contained in:
MarcoViglione-Laser
2019-09-05 13:01:50 +02:00
committed by Benedek Farkas
parent ac11024be4
commit 5815a2b9fa

View File

@@ -1,4 +1,4 @@
using Orchard.ContentManagement;
using Orchard.ContentManagement;
using Orchard.ContentManagement.MetaData;
using Orchard.Data;
using Orchard.Environment.Configuration;
@@ -65,11 +65,11 @@ namespace Orchard.Taxonomies.Services {
}
protected override void PublishTerm(TermPart term) {
// only publish the term if it was published already
if (term.ContentItem.IsPublished()) {
// Only publish the Term if it was published already.
if (term.ContentItem.HasPublished() && !term.ContentItem.IsPublished()) {
var contentItem = _contentManager.Get(term.ContentItem.Id, VersionOptions.DraftRequired);
_contentManager.Publish(contentItem);
}
}
}
}
}