Copied to clipboard

Flag this post as spam?

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


  • pvassalo 21 posts 28 karma points
    Apr 20, 2009 @ 13:11
    pvassalo
    0

    BeforePublish and BeforeSave Event Handlers

    Hi everyone!

    I'm trying to cancel a save event and so I was trying using the Event Handlers.
    I tried both BeforePublish and BeforeSave events.
    The BeforePublish works as expected (I can cancel it), but the BeforeSave doesn't.

    Here is some code I made for testing:
    [code]
    public class UmbracoEventHandlers : ApplicationBase
    {
    public UmbracoEventHandlers() {
    Document.BeforePublish += new Document.PublishEventHandler(DocumentBeforePublish);
    Document.BeforeSave += new Document.SaveEventHandler(Document
    BeforeSave);
    }

    void DocumentBeforeSave(Document sender, umbraco.cms.businesslogic.SaveEventArgs e) {
    e.Cancel = true;
    }

    void Document
    BeforePublish(Document sender, umbraco.cms.businesslogic.PublishEventArgs e) {
    e.Cancel = true;
    }
    }
    [/code]

    Both DocumentBeforeSave and DocumentBeforePublish are beeing runned because I put break points to assure that.
    Does anyone know what I can be doing wrong in the BeforeSave?

    thanks
    Pedro

  • Dirk De Grave 4534 posts 5980 karma points MVP 3x admin c-trib
    Apr 20, 2009 @ 13:16
    Dirk De Grave
    0

    Hi,

    See this work item on Codeplex: http://umbraco.codeplex.com/WorkItem/View.aspx?WorkItemId=21847

    Please vote for it to get if fixed asap!

    Regards,
    /Dirk

  • pvassalo 21 posts 28 karma points
    Apr 20, 2009 @ 13:23
    pvassalo
    0

    Thanks!
    This is terrible... ](*,)
    Just Voted !

  • pvassalo 21 posts 28 karma points
    Apr 20, 2009 @ 13:24
    pvassalo
    0

    Is there any workaround?...

  • Niels Hartvig 1949 posts 2379 karma points admin hq c-trib
    Apr 20, 2009 @ 17:14
    Niels Hartvig
    0

    This is a limitation in the current Umbraco architecture (it persists data immedially upon property set) and there's no fix nor a workaround for the Umbraco 4.0.x lifespan (ie at least next six months).

  • Stuart Neal 9 posts 29 karma points
    May 09, 2013 @ 17:24
    Stuart Neal
    0

    This is not good enough.

    I can accept that something doesn't work and can't be fixed in 4.x owing to the underlying architecture.

    I CANNOT accept that this is not documented on the class or in the event declaration, and that I will only find it out after doing a week of work and selling myself down the river along this path. And then only find out from some 4 year old forum post after a load of searching. 

    This is supposed to be professional software. As such, it behoves you to document its limitations. Otherwise, professional sofware developers are going to be wasting their time, and losing their patience with it.

Please Sign in or register to post replies

Write your reply to:

Draft