Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Andreas Iseli 150 posts 427 karma points
    Mar 09, 2013 @ 19:07
    Andreas Iseli
    0

    IContentService Events: Cancel not working?

    I've attached a little event handler to the content service for "Creating", "Created" and "Saved". When using the event arguments of the "Creating" method and setting e.Cancel = true, the "Created" event is no more called but still the "Saved" event and the item is still being created.

    Can someone tell me if I have misunderstood the concept or if this may be a bug? Im using v6.0.2. 

    Thanks

  • Andreas Iseli 150 posts 427 karma points
    Mar 10, 2013 @ 11:36
    Andreas Iseli
    100

    Well I just discovered that this is my fault because when creating an item through the UI, still the Document.MakeNew() is called and not IContentService.CreateContent().

    Good to know: Document.MakeNew() calls IContentService.CreateContent() but has its own cancelling event in before. Therefore the content is still being created and cannot be cancelled through the IContentService events only!

  • Andreas Iseli 150 posts 427 karma points
    Mar 10, 2013 @ 12:07
    Andreas Iseli
    0

    I've opened a bug report because the handling is not 100% correct regarding to the backwardcompatibility of the Document events that are obsolete in v6.

    http://issues.umbraco.org/issue/U4-1875

Please Sign in or register to post replies

Write your reply to:

Draft