Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Arne 16 posts 37 karma points
    Sep 24, 2012 @ 15:15
    Arne
    0

    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:

    • Runs in 1 application pool on IIS7.
    • Uses multiple hostnames (2 websites, 1 hostname each).

    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.

    Thank you all in advance and regards,
    Arne

  • Arne 16 posts 37 karma points
    Sep 25, 2012 @ 09:43
    Arne
    0

    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.

Please Sign in or register to post replies

Write your reply to:

Draft