Quantcast
Channel: ActiveTopics
Viewing all articles
Browse latest Browse all 72689

Published EventHandler not populating url?

$
0
0

Using Umbraco 6.1.3. I am trying to use the Published EventHandler to update an external file based on the content published.  I am able grab property values from the content and write to this external file, but I need to get the url of the published page as well.  To do this, I am using:

 

private void UpdateTableFileEventHandler(Umbraco.Core.Publishing.IPublishingStrategy sender, Umbraco.Core.Events.PublishEventArgs e)
{
foreach (var item in e.PublishedEntities)
{
UmbracoHelper UMHelper = new UmbracoHelper(UmbracoContext.Current);
IPublishedContent publishedContent = UMHelper.TypedContent(item.Id);
}
}

This works, as long as the document has been published before, but if it is a new document, apparently it isn't in the cache yet because I get a null reference. Anyone know how to grab the url of a newly published item? I only see 'Publishing' and 'Published' as options and I've tried both. What am I doing wrong?


Viewing all articles
Browse latest Browse all 72689

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>