Copied to clipboard

Flag this post as spam?

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


  • Marc-Anthony Taylor 55 posts 68 karma points
    Dec 05, 2012 @ 09:58
    Marc-Anthony Taylor
    0

    Delegate no longer removed

    I have a class set up to duplicate content for a multilang site. It was working perfectly until I recieved the database from a colleague (he had all the correct docTypes) and now when I copy a doc the delegate is no longer removed. Nothing was changed in the code but it now creates multiple copies under each parent node.

    foreach (var id in _listOfParentIds.Where(id => id != parentNode.Id))
                                {
                                    lock (Locker)
                                    {
                                        Document.New -= SaveLangDupelicates;    //  remove event to prevent it from firing after copying
                                        dupeDoc.Copy(id, User.GetCurrent(), true);  //  copy the document to the relevant parent node                                   
                                        Document.New += SaveLangDupelicates;    //  reinstate the event
                                    }
                                }

     

Please Sign in or register to post replies

Write your reply to:

Draft