Created
June 28, 2012 08:06
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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