#20574: Optimizing transaction log

Work Item: 20574
This commit is contained in:
Sebastien Ros 2014-05-02 10:06:50 -07:00
parent dd1842bb13
commit 9525bf9e09
2 changed files with 11 additions and 6 deletions

View File

@ -27,11 +27,8 @@ namespace Orchard.Comments.Controllers {
return this.RedirectLocal(returnUrl, "~/");
var comment = Services.ContentManager.New<CommentPart>("Comment");
Services.ContentManager.Create(comment, VersionOptions.Draft);
var editorShape = Services.ContentManager.UpdateEditor(comment, this);
if (!ModelState.IsValidField("Comments.Author")) {
Services.Notifier.Error(T("Name is mandatory and must have less than 255 chars"));
}

View File

@ -33,9 +33,17 @@ namespace Orchard.Workflows.Handlers {
() => new Dictionary<string, object> { { "Content", context.ContentItem } }));
OnUpdated<ContentPart>(
(context, part) =>
workflowManager.TriggerEvent("ContentUpdated", context.ContentItem,
() => new Dictionary<string, object> { { "Content", context.ContentItem } }));
(context, part) => {
if(context.ContentItemRecord == null) {
return;
}
workflowManager.TriggerEvent(
"ContentUpdated",
context.ContentItem,
() => new Dictionary<string, object> { { "Content", context.ContentItem } }
);
});
}
}
}