Copied to clipboard

Flag this post as spam?

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


  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Sep 01, 2010 @ 15:35
    Jeroen Breuer
    0

    No Document.BeforeNew event?

    Hello,

    I've got the following situation. There is a DocumentType which only 1 node can have. If the user tries to create it again I want to cancel the creation. This is currently not possible since there is no BeforeNew event. Is there another way to do this? Currently I can delete it in the AfterNew event, but that doesn't seem like the best way to do it. 

    P.S. The node can be copied so I can't remove it from the structure after it's created for 1 time.

    Jeroen

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Sep 01, 2010 @ 15:49
    Jeroen Breuer
    0

    Ok it's seems there is an before new event after looking at the source code. Document.Newing is called before the document is created. Looks like Umbraco v5 needs some better name convention...

    Jeroen

  • Aaron Powell 1708 posts 3046 karma points c-trib
    Sep 02, 2010 @ 00:40
    Aaron Powell
    0

    Newing is the correct naming convention for an event, not prefixing with Before or After and unfortunately the mistake was made which resulted in inconsistent naming of the event.

    v5 (assuming it has this style of eventing system) will use proper .NET standards for naming.

Please Sign in or register to post replies

Write your reply to:

Draft