MovedContent event in IContentEvents repository

Vote:
 

When moving a page within the same page-node it was originally in, the MovedContent even won't fire. Instead PublishContent event is fired for all pages whos PeerOrder needs change. For the moved page the SaveAction Publish is set and for the siblings the SaveAction Publish, ForceCurrentVersion and SkipValidation is set.

Why isn't the MovedContent event fired in this scenario and is there anyway I can see that the page is moved when looking in PublishContent event?

#149970
Jun 10, 2016 8:49
Vote:
 

You could check the current page in Publishing event and store PeerOrder and content reference for the current page. Then check in published event if that has changed... I think I do that for something similar and store it in httpcontext.Items collection to easily compare changes. 

Move event will only be triggered if you move it in the page tree (change parent...). It will however not trigger for the children of the page being moved btw so you need to deal with that as well :)

Alternatively, load the previously published version in published event and compare PeerOrder with the currently published page.

#149973
Edited, Jun 10, 2016 9:44
Vote:
 

You're not moving the page, you're sorting pages. I guess.

What are you trying to achieve?

#149984
Jun 10, 2016 13:58
Vote:
 

I would say it's still a move since the editor is drag and dropping a page to a new location. I was able to solve this with Daniels suggestion by storing how the page looked before the move and then comparing it to what it became after the move. It's not pretty code but it works.

#150178
Jun 13, 2016 13:00
Vote:
 

I agree to disagree :)

You're not moving the page to a new location, hence the URL to the page doesn't change. Your're only updating the sort index, and maybe the parent's sorting rule.

Glad you could solve you're issue anyway.

#150179
Jun 13, 2016 13:07
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.