Content initialized (was already in context) after calling umbraco.library.UpdateDocumentCache
Hi,
On DebugView app, when I call umbraco.library.UpdateDocumentCache(docID) I get 7,868 lines of "[4868] Content initialized (was already in context)" message. And I think this is odd, I'm expecting just one line of this message displayed. Below is my code and let me know if I'm doing stuff incorrectly.
Content initialized (was already in context) after calling umbraco.library.UpdateDocumentCache
Hi,
On DebugView app, when I call umbraco.library.UpdateDocumentCache(docID) I get 7,868 lines of "[4868] Content initialized (was already in context)" message. And I think this is odd, I'm expecting just one line of this message displayed. Below is my code and let me know if I'm doing stuff incorrectly.
IEnumerable<Node> allNodes = GetNodes(<DocumentType>);
if (allNodes != null) {
var q = (from b in allNodes where (NodeLibrary.GetNodeProperty(b, "isApproved", "0") == "1") select b);
//select a random node
int index = new Random().Next(q.Count());
Node selectedNode = q.Skip(index).First<Node>();
if ( selectedNode != null)
{
Document docNode = new Document( selectedNode.Id);
docNode.getProperty("selectionDate").Value = DateTime.Now.ToString("yyyy-MM-dd");
docNode.Publish(User.GetUser(0));
umbraco.library.UpdateDocumentCache(docNode.Id);
}
}
is working on a reply...