I'm trying to write a News application with automatic archiving. My code is very similar to the solution detailed at http://deeper.webangelo.net/2010/4/9/blog4umbraco-post-date.aspx , except I'm using the AfterUnPublish event. Everything works fine when I manually unpublish the node, but I'm getting errors when I use the "Remove At" date to unpublish the node.
I've done some debugging and it seems that the errors are being caused when it hits the library.UpdateDocumentCache() and new Node() methods.
This is the stack trace from hitting library.UpdateDocumentCache() :
Error publishing node: System.NullReferenceException: Object reference not set to an instance of an object. at umbraco.presentation.UmbracoContext.get_Current() at umbraco.library.GetXmlNodeById(String id) at UmbracoExamine.ContentExtensions.ToXDocument(Content node, Boolean cacheOnly) at UmbracoExamine.UmbracoEventManager.content_AfterUpdateDocumentCache(Document sender, DocumentCacheEventArgs e) at umbraco.content.DocumentCacheEventHandler.Invoke(Document sender, DocumentCacheEventArgs e) at umbraco.content.FireAfterUpdateDocumentCache(Document sender, DocumentCacheEventArgs e) at umbraco.content.UpdateDocumentCache(Document d) at umbraco.content.UpdateDocumentCache(Int32 pageId) at umbraco.library.UpdateDocumentCache(Int32 DocumentId) at umbraco.presentation.publishingService.CheckPublishing(Object sender)
I'm running 4.7 now, but I had the same problem in 4.6.1.
What's different about "Remove At" that could be causing these errors?
void Document_AfterPublish(Document sender, PublishEventArgs e) { var rootNode = umbraco.library.GetXmlNodeById(ROOT_NODE_ID.ToString());
This breaks on GetXmlNodeById. I am sure the ID I am supplying is correct - this works perfectly when I publish the node manually, however when I use the Publish At feature, it throws a NullReferenceError
remove at event errors
I'm trying to write a News application with automatic archiving. My code is very similar to the solution detailed at http://deeper.webangelo.net/2010/4/9/blog4umbraco-post-date.aspx , except I'm using the AfterUnPublish event. Everything works fine when I manually unpublish the node, but I'm getting errors when I use the "Remove At" date to unpublish the node.
I've done some debugging and it seems that the errors are being caused when it hits the library.UpdateDocumentCache() and new Node() methods.
This is the stack trace from hitting library.UpdateDocumentCache() :
I'm running 4.7 now, but I had the same problem in 4.6.1.
What's different about "Remove At" that could be causing these errors?
Thanks
I get this issue also.
This breaks on GetXmlNodeById. I am sure the ID I am supplying is correct - this works perfectly when I publish the node manually, however when I use the Publish At feature, it throws a NullReferenceError
Edit: That's on 4.6.1 btw
is working on a reply...