Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I am using the ContentService.Publishing event to update some fields in the parent node when the child node is published. This is working though I am finding that the Last Edited date on the parent is being updated automatically. Is there anyway I can avoid this happening? Snippet below:
private void ContentServicePublished(IPublishingStrategy sender, PublishEventArgs<IContent> e)
foreach (var node in e.PublishedEntities)
if (node.ContentType.Alias == "DiscussionReply")
var contentService = new Umbraco.Core.Services.ContentService();
var parentNode = contentService.GetById(node.ParentId);
int intSiblings = parentNode.Children().Count() + 1;
string strTitle = parentNode.Name;
Bump. I'm trying to work this out too.
I had the same issue and I didn't find a way to prevent updateting the updateDate field of the parent node. From my previous research I understand that this system field is not supposed to be used for business logic. When you publish item via contentService.SaveAndPublishWithStatus(parentNode); a lot of thing happens behind - a new version of the node is created (see your versions) and a record is created in the Authid trail.
In my case I change my business logic to not work with this date. If you have an option just create new custom field - myLastUpdateDate and work with this field instead of updateDate.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted