Copied to clipboard

Flag this post as spam?

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


  • Son Pham 31 posts 72 karma points
    Jun 12, 2015 @ 09:24
    Son Pham
    0

    Some events does not fire

    I have implemented to listen to event. But some of them does not work. The code worked correctly with Saved and MenuRendering event but does not work with Deleted and also Deleting. I am using version 7.2.2. Do I miss something ? Thanks

    public class RegisterEvents : ApplicationEventHandler
    {
        protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
        {
            ContentService.Saved += ContentService_Saved;
            ContentService.Deleted += ContentService_Deleted;
            TreeControllerBase.MenuRendering += TreeControllerBase_MenuRendering;
        }
    }
    
  • Maff 141 posts 465 karma points
    Jun 15, 2015 @ 10:19
    Maff
    0

    Hi Son,

    Your overrides are processed when the Umbraco application starts so unless you've restarted your application (by recycling the App Pool) then these intercepts won't fire.

    Thanks,

    Maff

  • Son Pham 31 posts 72 karma points
    Jun 15, 2015 @ 19:35
    Son Pham
    0

    Hi Maff Thank you for your reply. I am testing from localhost visual studio. Everytime I try to debug with F5 then I think the application has been recycled so the events should work fine but in reality it does not. I tried with F5 and create some stuff and save. SAVED event raise. Right click on my content. MenuRendering event raise. But Right click and delete item. DELETED event does not fire. That's weird

  • Maff 141 posts 465 karma points
    Jun 15, 2015 @ 21:21
    Maff
    100

    Hi,

    When you right click > delete an item, you're not actually deleting it but moving it to the Recycle Bin. So try overriding the TRASHED event rather than the DELETED event.

    See here for a full list of the Content Service events and an explanation of when they fire.

    Thanks,

    Maff

Please Sign in or register to post replies

Write your reply to:

Draft