Bug in DeletingPage event handler when emptying the Recycle Bin?

Vote:
 
  1. Hook an event to DeletingPage.  Put a breakpoint in it and debug.

  2. Delete a page from the page tree.  (This won't trigger the handler, since you're really just moving it to the Recycle Bin.)

  3. Now go delete the page from the Recycle Bin.  (Do not empty the Recycle Bin, just right click this one page and delete.)  The "e.PageLink.ID" that gets passed to your DeletingPage event handler should be the correct ID of the page you just deleted.  This is expected behavior.

  4. Delete another page from the page tree.

  5. Now click on the Recycle Bin and hit the "Empty" button in the right pane. When your breakpoint hits, it won't be the ID of the page in the Recycle Bin, it will be "2", the ID of the Recycle Bin itself.  Additionally, it will get hit only once, no matter how many pages are being deleted.

This means that if you do some cleanup or something when deleting pages, your code won't run when someone mass deletes the contents of the Recycle Bin.

Is this a bug, or am I doing something wrong?

#52299
Jul 16, 2011 0:13
Vote:
 

You can change this behavior by setting the operationCompability to "PageStoreDelete" in EpiServer.config

#52356
Jul 19, 2011 18:47
Vote:
 

I confirmed that this works.  Can you give some more background on this -- why does this setting exist?  Are their are side effects?  (I mean, it has to be this way for a reason, right?)

#52357
Jul 19, 2011 20:14
Vote:
 

I got this explanation back from support.

They included that flag for compability and performance reasons. Apparently they didn't list every child (when deleting) because of performance, but in the later releases (later than R2) they had to revert back to the old behavior of listing every child because of a bug with cache invalidation. So if you have CMS 6, there shouldn't be any performance issues enabling the old behavior at all.

#52380
Jul 20, 2011 15:57
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.