U4-3804 - ContentService.SendingToPublish and ContentService.SentToPublish Events not firing

Created by Tim Grove 05 Dec 2013, 17:52:08 Updated by Sebastiaan Janssen 05 Dec 2013, 21:34:56

ContentService.SendingToPublish and ContentService.SentToPublish events are not being trigged on publishing.

public class UmbracoEventHandlers : ApplicationEventHandler { public UmbracoEventHandlers() { ContentService.SendingToPublish += Content_SendingToPublish; ContentService.SentToPublish += Content_SentToPublish; } private void Content_SendingToPublish(IContentService sender, SendToPublishEventArgs e) { // not being hit with a breakpoint if (e.Entity.ContentType.Alias == "Test") {

    }
}

private void Content_SentToPublish(IContentService sender, SendToPublishEventArgs<IContent> e)
{
    // not being hit with a breakpoint
    if (e.Entity.ContentType.Alias == "Test")
    {
    }
}

}

Comments

Sebastiaan Janssen 05 Dec 2013, 18:42:50

Send to publish is an option only for editors who can not directly publish. So they have to select "Send to publish" in the menu.

Are you sure you don't want to listen to ContentService.Publishing and ContentService.Published?


Tim Grove 05 Dec 2013, 21:18:34

My bad, you are correct, I was wiring up the wrong events


Sebastiaan Janssen 05 Dec 2013, 21:34:56

No worries! :)


Priority: Normal

Type: Bug

State: Closed

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions: 7.0.0

Due in version:

Sprint:

Story Points:

Cycle: