mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-27 04:19:04 +08:00
@@ -34,6 +34,9 @@ namespace Orchard.AuditTrail.Providers.Content {
|
||||
protected override void Updating(UpdateContentContext context) {
|
||||
var contentItem = context.ContentItem;
|
||||
|
||||
if (contentItem.IsNew())
|
||||
return;
|
||||
|
||||
_ignoreExportHandlerFor = contentItem;
|
||||
_previousVersionXml = _contentItemCreated
|
||||
? default(XElement) // No need to do a diff on a newly created content item.
|
||||
@@ -44,6 +47,9 @@ namespace Orchard.AuditTrail.Providers.Content {
|
||||
protected override void Updated(UpdateContentContext context) {
|
||||
var contentItem = context.ContentItem;
|
||||
|
||||
if (contentItem.IsNew())
|
||||
return;
|
||||
|
||||
if (_contentItemCreated) {
|
||||
RecordAuditTrailEvent(ContentAuditTrailEventProvider.Created, context.ContentItem);
|
||||
}
|
||||
|
||||
@@ -35,7 +35,9 @@ namespace Orchard.AuditTrail.Services {
|
||||
case XmlNodeType.Element:
|
||||
var match = reader.GetAttribute("match");
|
||||
var isAttributeChange = match != null && match.StartsWith("@");
|
||||
var index = match == null || isAttributeChange ? default(int?) : Int32.Parse(match) - 1;
|
||||
int matchInt;
|
||||
var index = match == null || isAttributeChange || !Int32.TryParse(match, out matchInt)
|
||||
? default(int?) : matchInt - 1;
|
||||
var diffType = reader.LocalName;
|
||||
var currentElement = stack.Peek();
|
||||
|
||||
|
||||
@@ -46,7 +46,9 @@ namespace Orchard.Comments.Controllers {
|
||||
}
|
||||
|
||||
if (ModelState.IsValid) {
|
||||
Services.ContentManager.Create(comment);
|
||||
Services.ContentManager.Create(comment, VersionOptions.Draft);
|
||||
Services.ContentManager.UpdateEditor(comment, this);
|
||||
Services.ContentManager.Publish(comment.ContentItem);
|
||||
|
||||
var commentPart = comment.As<CommentPart>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user