Skip to content

Instantly share code, notes, and snippets.

@karlitros
Created June 28, 2012 08:06
Show Gist options
  • Save karlitros/3009818 to your computer and use it in GitHub Desktop.
Save karlitros/3009818 to your computer and use it in GitHub Desktop.
A fix to allow document urls to update in the Umbraco back office after moving a document programmatically
//newParentFolderId = the parentId you want to move the document to
//documentObject = the document you're moving to its new location.
documentObject.Move(newParentFolderId);
if (!autoFolder.EnableBatchProcessing)
{
library.RefreshContent();
documentObject.Publish(new User(0));
library.UpdateDocumentCache(documentObject.Id);
System.Xml.XmlDocument xd = new System.Xml.XmlDocument();
documentObject.XmlGenerate(xd);
library.RefreshContent();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment