mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-26 03:40:56 +08:00
@@ -34,7 +34,10 @@ namespace Orchard.AuditTrail.Providers.Content {
|
||||
protected override void Updating(UpdateContentContext context) {
|
||||
var contentItem = context.ContentItem;
|
||||
|
||||
_ignoreExportHandlerFor = contentItem;
|
||||
if (contentItem.IsNew())
|
||||
return;
|
||||
|
||||
_ignoreExportHandlerFor = contentItem;
|
||||
_previousVersionXml = _contentItemCreated
|
||||
? default(XElement) // No need to do a diff on a newly created content item.
|
||||
: _contentManager.Export(contentItem);
|
||||
@@ -43,7 +46,10 @@ 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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user