#20505: Fixing terms publication

Work Item: 20505
This commit is contained in:
Josh Berry
2014-03-14 17:55:25 -07:00
committed by Sebastien Ros
parent 4bed5c1a9a
commit 1b1f04a9c6

View File

@@ -167,6 +167,9 @@ namespace Orchard.Taxonomies.Controllers {
var term = _taxonomyService.NewTerm(taxonomy);
term.Container = parentTerm == null ? taxonomy.ContentItem : parentTerm.ContentItem;
// Create content item before updating so attached fields save correctly
Services.ContentManager.Create(term, VersionOptions.Draft);
var model = Services.ContentManager.UpdateEditor(term, this);
if (!ModelState.IsValid) {
@@ -175,7 +178,7 @@ namespace Orchard.Taxonomies.Controllers {
}
_taxonomyService.ProcessPath(term);
Services.ContentManager.Create(term, VersionOptions.Published);
Services.ContentManager.Publish(term.ContentItem);
Services.Notifier.Information(T("The {0} term has been created.", term.Name));
return RedirectToAction("Index", "TermAdmin", new { taxonomyId });