简体   繁体   中英

Umbraco 4.8, Document save Publish

Umbraco 4.8 had bug in umbraco.cms.businesslogic.web.Document.Publish method? I try to edit a node, save and Publish a node. I can look in BackOffice that the node is changed correctly. In web page, I use razor to render to HTML. This cshtml file use umbrac.MacroEngines.DynamicNode. This node version returns the old value. Then, in BackOffice, I try to click "Salve and Publish", then webpage render the correct data.

DynamicNode accesses the node's information from the umbraco.config cache, it doesn't directly access the database (See Difference between Node and Document ). Saving and Publishing do not update the cache by themselves, there is an additional step. Example:

Document document = new Document(1234);
document.Text = "New Title";
document.Publish(User.GetUser(0));    
umbraco.library.UpdateDocumentCache(document.Id);

See Publishing and republishing for more details.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM