Copied to clipboard

Flag this post as spam?

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


  • Paul D'Ambra 10 posts 81 karma points
    Nov 01, 2016 @ 20:26
    Paul D'Ambra
    0

    Parent not updating when viewed from child

    Apologies this is a bit light on detail as I'm at home and don't have access to the code but I'm hoping my misunderstanding is fundamental enough that someone can clear it up for me...

    I've got a 7.3.8 website and have written a console application (using this as an example https://github.com/sitereactor/umbraco-console-example)

    The console application runs as a TopShelf service and (for the purposes of simplifying the question) it gets the ContentService, loads the roots, finds the Home node and then walks the tree of published content generating the URL of each item.

    The app runs on a timer. If I use the site to publish a change that affects a node's URL it correctly sees the change to the node but not to its children's URL.

    If I then restart the application and so generate a new ApplicationContext all the generated URLs are correct again.

    e.g.

    "Parent 1" --> "Child 1"

    parent 1 url is /parent-1/ child 1 url is /parent-1/child-1

    if I change parent 1 display name and re-run the app

    "Parent 1 a" --> "Child 1"

    parent 1 url is /parent-1-a/ child1 url is /parent-1/child-1

    It seems that the child nodes are caching their parents so that even though loading the parent on its own is correct the child's reference to the parent is out-of-date.

    Assuming that's clear enough to diagnose without showing the code is it possible to diagnose the problem?

  • Paul D'Ambra 10 posts 81 karma points
    Nov 02, 2016 @ 10:32
    Paul D'Ambra
    0

    The more I think about this the more I wonder if it's a bug in Umbraco.

    If ApplicationContext A publishes a change then in ApplicationContextB for the same database

    IContent.Children() returns updated IContent

    whereas from one of those children within IContent.Children results IContent.Parent returns the IContent from before the update.

Please Sign in or register to post replies

Write your reply to:

Draft