Just looked it up on the umbraco source, cache is cleared when calling library.UnPublishSingleNode() which is done AFTER .UnPublish() and so after that specific event is fired.
I only want to run my custom event handler code after a node has been unpublished (or deleted, which I believe also triggers the AfterUnPublish event). Is there a way to hook into AfterClearDocumentCache and test to see whether it was an unpublish or delete that caused it? Otherwise it will run every time the cache is cleared...
I think I have it working... in the AfterUnPublish event, I'm making a forced call to library.UnPublishSingleNode(sender.Id) before I do the Examine re-index. This might mean that UnPublishSingleNode is fired twice...?
AfterUnPublish event still shows the node as one of its parent's children in NodeFactory
I'm pretty sure the cache is only cleared afterwards, I'd suggest to use content.AfterClearDocumentCache and do your Examine index tweaking then.
Cheers,
/Dirk
Just looked it up on the umbraco source, cache is cleared when calling library.UnPublishSingleNode() which is done AFTER .UnPublish() and so after that specific event is fired.
Cheers,
/Dirk
Seems a bit odd, but OK....
I only want to run my custom event handler code after a node has been unpublished (or deleted, which I believe also triggers the AfterUnPublish event). Is there a way to hook into AfterClearDocumentCache and test to see whether it was an unpublish or delete that caused it? Otherwise it will run every time the cache is cleared...
Mike
Hmm, not sure if you can find those details, I guess you can check the .Published property or else check path (-1,20 for recycle bin)...
I think I have it working... in the AfterUnPublish event, I'm making a forced call to library.UnPublishSingleNode(sender.Id) before I do the Examine re-index. This might mean that UnPublishSingleNode is fired twice...?
is working on a reply...