mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-04-05 21:01:35 +08:00
parent
dd1842bb13
commit
9525bf9e09
@ -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"));
|
||||
}
|
||||
|
@ -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 } }
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user