Copied to clipboard

Flag this post as spam?

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


  • Sebastiaan Janssen 4899 posts 14655 karma points MVP admin hq
    Sep 21, 2009 @ 09:37
    Sebastiaan Janssen
    0

    Unpublished pages showing through GetXmlNodeById

    I have a few pages that haven't been published yet. When I do umbraco.library:GetXmlNodeById($nodeId), and the $nodeId contains the ID of an unpublished page, I still get the content of that node. Is that supposed to happen? If yes, how can I test that the node has been published?

  • Niels Hartvig 1951 posts 2391 karma points admin hq c-trib
    Sep 21, 2009 @ 11:47
    Niels Hartvig
    1

    That's not possible - I've just looked at the code and it's only accessing the published xml. So the node must be published some how?!?

  • Sebastiaan Janssen 4899 posts 14655 karma points MVP admin hq
    Sep 21, 2009 @ 11:56
    Sebastiaan Janssen
    0

    I just remembered that I created these pages through the API, this is code I re-used from Nord's multi file uploader

    document.Save();
    document.XmlGenerate(new XmlDocument());

    When I remove XmlGenerate, everything is fine and dandy! ;)

    Thanks for checking Niels!

  • Niels Hartvig 1951 posts 2391 karma points admin hq c-trib
    Sep 21, 2009 @ 12:02
    Niels Hartvig
    0

    Still - the XmlGenerate doesn't populate the global published index. There must be something else going on.

  • Sebastiaan Janssen 4899 posts 14655 karma points MVP admin hq
    Sep 21, 2009 @ 12:19
    Sebastiaan Janssen
    1

    Ah, you are correct sir!

    What happened was that I had deleted the umbraco.config file at some point because of a problem I was having with the lucene indexing. When the umbraco.config was re-created, the unpublished nodes were also in there. 

    Is this expected behaviour?

  • Niels Hartvig 1951 posts 2391 karma points admin hq c-trib
    Sep 21, 2009 @ 12:39
    Niels Hartvig
    0

    Nope, that's definitely a bug. I'll take a look :)

  • Niels Hartvig 1951 posts 2391 karma points admin hq c-trib
    Sep 21, 2009 @ 12:56
    Niels Hartvig
    0

    Found the bug and fixed it. Will be a part of 4.0.3. Thanks for your reports, Sebastiaan. Highly appreciated.

  • Sebastiaan Janssen 4899 posts 14655 karma points MVP admin hq
    Sep 21, 2009 @ 16:55
    Sebastiaan Janssen
    0

    No problemo, glad to be of some help! :-)

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies