0

I wired up the DeletedPage event in my Global.asax like this:

DataFactory.Instance.DeletedPage += this.Instance_DeletedPage;

And my handler:

    private void Instance_DeletedPage(object sender, PageEventArgs pageEventArgs)
    {
        DeleteCustomerRoles(pageEventArgs.PageLink);
    }

When I move a page to the wastebin, nothing fires of course since it is moved. When I delete the page from the wastebin - the event fires and I get the deleted page's PageLink in pageEventArgs.

But... When I instead select the wastebin and clicks on the "Empty wastebin" button, I get the PageLink corresponding to the wastebin - not my deleted page!

Is this a feature or a bug? I see that there is some sort of list of linked pages on the page object in the pageEventArgs, but I assume that all pages that are deleted (even children) will trigger the DeletedPage event. Is this not true?

Niklas Wulff
  • 3,497
  • 2
  • 22
  • 43

2 Answers2

0

Ok, this seems to be a known behaviour:

http://world.episerver.com/Support/Bug-list-beta/bug/33750/

Although there is a setting to revert some of the peculiar behavior, the wastebin part of it remains. I find this really odd, but it seems I'll have to look elsewhere to find a workaround for really getting to know when a page is deleted, regardless of how.

Niklas Wulff
  • 3,497
  • 2
  • 22
  • 43
0

Seems to be a way to get this working that neither or us apparently knew about:

http://world.episerver.com/Forum/Developer-forum/-EPiServer-75-CMS/Thread-Container/2014/8/Datafactory-deleted-page-event1/

http://world.episerver.com/Forum/Developer-forum/-EPiServer-75-CMS/Thread-Container/2014/5/Bug-in-DeletingPage/

Hope you will find this information helpful! /Martin