Currently, I'm working on an Umbraco website (v4.7.2) which exists for about 70% out of Razor scripts. In these Razor scripts, we make use of some nice DynamicNode methods, like "DescendantsOrSelf()". Some additional info on our project:
The bug occurs after publishing a node. We have a node ('Sectors'), containing childnodes of type 'Sector'. These childnodes are being used by another node ('LinkedSectors'), which has a property called 'LinkedMotorIds' of type 'uComponents XPathCheckBoxList' (v4.0.0). Adding 'Sector' nodes works well, as well as linking them with the XPath Checkbox list on the 'LinkedSectors' node.
In C#, we try to get all linked sectors, by using this piece of code (node = a DynamicNode instance): ((dynamic)node).LinkedMotorIds.Items
Thanks to the uComponents feature 'RazorModelBinding', the LinkedMotorIds-property returns a DynamicNodeList with all linked sectors.
What's the problem then?
After publishing the 'LinkedSectors' node (with the 'LinkedMotorIds'-property), it seems that an old version of the umbraco.config is being used. The latest linked node in 'LinkedSectors' does not appear in the LinkedMotorIds-property. It's gone / missing / has never been there!
A few things I figured out:
When using nodeFactory, all works well. The piece of XML, representing the LinkedMotorIds-property, does contain the latest linked node!
The umbraco.config file IS being updated after the publish. This file does contain the latest linked node.
Republish entire site doesn't solve the problem.
Touching the web.config does the trick (triggers a memory / cache reset?), however that of course isn't a solution.
It seems, there's a difference in the way nodeFactory and DynamicNode query the requested nodes. A little strange, because the latter is just some kind of wrapper for nodeFactory.Node, right? Can any expert over here share his thoughts on this? Seems pretty complex, but I hope you guys understand my problem.
We're using a caching technique (static List), where we store all 'sitenodes' (representing a website in our frontend). Side effect of this technique: children and descendants which are called once, are being kept in cache (singleton properties?). That explains our problems.
DynamicNode and publishing - missing items
Hi all,
Currently, I'm working on an Umbraco website (v4.7.2) which exists for about 70% out of Razor scripts. In these Razor scripts, we make use of some nice DynamicNode methods, like "DescendantsOrSelf()". Some additional info on our project:
The bug occurs after publishing a node. We have a node ('Sectors'), containing childnodes of type 'Sector'. These childnodes are being used by another node ('LinkedSectors'), which has a property called 'LinkedMotorIds' of type 'uComponents XPathCheckBoxList' (v4.0.0). Adding 'Sector' nodes works well, as well as linking them with the XPath Checkbox list on the 'LinkedSectors' node.
In C#, we try to get all linked sectors, by using this piece of code (node = a DynamicNode instance):
((dynamic)node).LinkedMotorIds.Items
Thanks to the uComponents feature 'RazorModelBinding', the LinkedMotorIds-property returns a DynamicNodeList with all linked sectors.
What's the problem then?
After publishing the 'LinkedSectors' node (with the 'LinkedMotorIds'-property), it seems that an old version of the umbraco.config is being used. The latest linked node in 'LinkedSectors' does not appear in the LinkedMotorIds-property. It's gone / missing / has never been there!
A few things I figured out:
It seems, there's a difference in the way nodeFactory and DynamicNode query the requested nodes. A little strange, because the latter is just some kind of wrapper for nodeFactory.Node, right? Can any expert over here share his thoughts on this? Seems pretty complex, but I hope you guys understand my problem.
Thank you all in advance and regards,
Arne
Problem solved (no bug)!
We're using a caching technique (static List), where we store all 'sitenodes' (representing a website in our frontend). Side effect of this technique: children and descendants which are called once, are being kept in cache (singleton properties?). That explains our problems.
is working on a reply...