Copied to clipboard

Flag this post as spam?

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


  • tentonipete 78 posts 223 karma points
    Nov 10, 2011 @ 22:43
    tentonipete
    0

    uQuery GetNodesByXML - am I going mad?

    I'm using the following code - I'm pretty sure it was working but I can't figure out why it isn't now!

    var nodeList= new List<Node>();
    var propertyValue = "<MultiNodePicker><nodeId>1089</nodeId><nodeId>1101</nodeId></MultiNodePicker>";
    nodeList= uQuery.GetNodesByXml(propertyValue);

    but nodeList.Count() is equal to 0...

    It's the standard MultiNodePicker XML as far as i'm aware.

  • Lee Kelleher 3876 posts 14569 karma points MVP 9x admin c-trib
    Nov 10, 2011 @ 22:54
    Lee Kelleher
    0

    Hi Joel,

    The code snippet looks correct to me - XML is valid for MNTP.  Question is - are the node ids correct? As in are they actually published nodes?

    Let us know, curious if there is anything else at play here.

    Cheers, Lee.

  • tentonipete 78 posts 223 karma points
    Nov 10, 2011 @ 23:06
    tentonipete
    0

    Hey Lee,

    Yeah they're all published media nodes. I've played around with different number of nodes in the MNTP but i'm stumped.

    Now I'm creating new properties on other pages to try it out there, see if I get the same problem!

    This is nuts. I'm using it elsewhere on exactly the same site, the equivalent of

    nodes = uQuery.GetNodesByXml("<MultiNodePicker><nodeId>1083</nodeId></MultiNodePicker>");

    and it's working fine!

    Joel

  • Lee Kelleher 3876 posts 14569 karma points MVP 9x admin c-trib
    Nov 10, 2011 @ 23:10
    Lee Kelleher
    2

    Joel, you're gonna kick yourself! ;-)

    You'll need...

    nodeList = uQuery.GetMediaByXml(propertyValue);

    The other one (GetNodesByXml) gets content nodes only.

    Cheers, Lee.

  • tentonipete 78 posts 223 karma points
    Nov 10, 2011 @ 23:15
    tentonipete
    1

    hahaha no way! 

    I just assumed that content node and media node inherited from just plain node...

    permission to update ucomponents codeplex documentation page?

    I'm currently on v2.1, notice GetMediaByXML is 2.2+. Best to go 2.2 or 3.0? (4.7 site)?

    Thanks BTW

  • Lee Kelleher 3876 posts 14569 karma points MVP 9x admin c-trib
    Nov 10, 2011 @ 23:19
    Lee Kelleher
    0

    Yeah, just noticed "GetMediaByXml" was added in v2.2 beta ... better to use v3.0 (which is really v2.2 ... we've just bumped the version number coz waaay to many people were using the v2.2 beta - difficult to keep track of).

    If you want to edit the CodePlex doco - let me know your CodePlex username, I can add you as an editor. :-D

    Thanks, Lee.

  • tentonipete 78 posts 223 karma points
    Nov 10, 2011 @ 23:30
    tentonipete
    0

    All sorted now. Was a very quick fix. 3.0 all the way!

    codeplex username is the same as here there and everywhere :)

    Probably won't be any huge additions, just a note when I find something out like this.

  • Lee Kelleher 3876 posts 14569 karma points MVP 9x admin c-trib
    Nov 10, 2011 @ 23:34
    Lee Kelleher
    0

    Hey Joel, was going to guess your username, but ya never know! :-)

    Welcome to the uComponents team! (Sounds scary huh?! We'll celebrate next umBristol meetup)

    Cheers, Lee.

     

Please Sign in or register to post replies

Write your reply to:

Draft