Can someone confirm me that if I set the CANCEL = TRUE on the event that the Copy will not occur ?
What happens with multiple node copy ?
Is the event called for any node that need to be copied ? If we cancel the main document copy, are we sure that the other nodes won't be copied somehow ?
I want to replace the current Copy function to maintain relation between elements and be able to copy a complete site. I already had some bad surprises when trying to cancel a save :-) So I'm just wondering if I should completely reimplement the copy function, or I just can cancel the copy document handler and do my stuff.
Having a quick look at the source (see Copy method), that does seem to be the case. If cancelled via BeforeCopy the copy will not occur, nor will it attempt to copy children nodes.
When the copy occurs it then loops through the children and calls the Copy method on them also. So if you cancel one of those, it should only affect that child node and it's children, I believe the remaining sibling nodes will still copy.
Ok it seems clear that it stop the copies, if the root node is cancelled... So I can go ahead !! But now I'm struggling with creating a new section in the CMS... Every single thing to be customized take hours to find that stupid documentation that could help :)
The master piece of the day is certainly the [treeHandlerAssembly], [treeHandlerType] fields in the umbracoAppTree : That actually are totally not info on the Assembly, and totally not an info about the Type... Or does the assembly name to be the root of your namespace ? Somewhat stupid !!! They should ask people before implementing such #@#{[#@# :-)
Document_BeforeCopy
Can someone confirm me that if I set the CANCEL = TRUE on the event that the Copy will not occur ?
What happens with multiple node copy ?
Is the event called for any node that need to be copied ? If we cancel the main document copy, are we sure that the other nodes won't be copied somehow ?
I want to replace the current Copy function to maintain relation between elements and be able to copy a complete site. I already had some bad surprises when trying to cancel a save :-) So I'm just wondering if I should completely reimplement the copy function, or I just can cancel the copy document handler and do my stuff.
Hi Laurent,
Having a quick look at the source (see Copy method), that does seem to be the case. If cancelled via BeforeCopy the copy will not occur, nor will it attempt to copy children nodes.
When the copy occurs it then loops through the children and calls the Copy method on them also. So if you cancel one of those, it should only affect that child node and it's children, I believe the remaining sibling nodes will still copy.
-Tom
Ok it seems clear that it stop the copies, if the root node is cancelled... So I can go ahead !! But now I'm struggling with creating a new section in the CMS... Every single thing to be customized take hours to find that stupid documentation that could help :)
The master piece of the day is certainly the [treeHandlerAssembly], [treeHandlerType] fields in the umbracoAppTree : That actually are totally not info on the Assembly, and totally not an info about the Type... Or does the assembly name to be the root of your namespace ? Somewhat stupid !!! They should ask people before implementing such #@#{[#@# :-)
is working on a reply...