Hi,
I have a general problem with the ApplicationEventHandler, as it doesn't seem to fire the event that I could use.
I want execute some code and (bulk)save a couple of properties for every document when I Publish an entire tree at once in the CMS.
So this has to happen before publishing, not after.
This is how my custom eventhandler looks; does anyone know why these two events aren't working?
Thanks!
public class EventHandler : ApplicationEventHandler
{
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
base.ApplicationStarted(umbracoApplication, applicationContext);
ContentService.SendingToPublish += PublishingStrategy_Publishing;
ContentService.SentToPublish += ContentService_SentToPublish;
ContentService.Published += ContentService_Published;
}
}
void ContentService_Published(Umbraco.Core.Publishing.IPublishingStrategy sender, Umbraco.Core.Events.PublishEventArgs e)
{
//This guy works, but it's not what I need
}
void ContentService_SentToPublish(IContentService sender, Umbraco.Core.Events.SendToPublishEventArgs e)
{
//Never fires
}
void PublishingStrategy_Publishing(IContentService sender, Umbraco.Core.Events.SendToPublishEventArgs e)
{
//Never fires
}
v6.1.6 Eventhandler SendToPublish
Hi, I have a general problem with the ApplicationEventHandler, as it doesn't seem to fire the event that I could use.
I want execute some code and (bulk)save a couple of properties for every document when I Publish an entire tree at once in the CMS. So this has to happen before publishing, not after.
This is how my custom eventhandler looks; does anyone know why these two events aren't working?
Thanks!
"solved it", by using the depricated Document.BeforePublish instead of the ContentService.
is working on a reply...