Friday, 7 September 2012

Issues relating to XML Caching - 1

After publish xml cache is not properly refreshed. The same doctype element is re-added, and for example, an XSLT Menu macro shows too many pages.
.../editContent.aspx.cs (315)
.../umbraco/presentation/content/content.cs line 392 calls GetElementById
-> attr.attr.OwnerElement.IsRooted (604)
-> XmlLinkedNode (52) returns false for the published document.
This is a mono issue. There is no IsRooted in the MS .net documentation.
In content.cs change
393 from,

	XmlNode x = xmlContentCopy.GetElementById(id.ToString())
//Deal with IsRooted being false in mono for the published node
string xpathId = UmbracoSettings.UseLegacyXmlSchema ?
String.Format ("//node[@id = '{0}'], id.ToString()") :
String.Format ("//*[@isDoc][@id='{0}']", id.ToString());
XmlNode x = xmlContentCopy.SelectSingleNode(xpathId);

(Not so sure about the legacy syntax...) & did not vet load balancing. As far as I can tell, there is an 'IsRooted' property on Xml documents, which is set to false during the operations in getPreviewOrPublishNode(...), and the consequent call to GetElementById in AppendDocumentXml (content.cs, 393) returns null and breaks the code. That's why we do not use XmlNode x = xmlContentCopy.GetElementById(id.ToString()) here.


No comments:

Post a Comment

Note: only a member of this blog may post a comment.