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
}
}
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.
is working on a reply...