Copied to clipboard

Flag this post as spam?

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


  • Marcus 29 posts 150 karma points
    Dec 28, 2023 @ 08:07
    Marcus
    1

    XPathValue must be an XPathNavigator or a string

    Hi guys

    I got this error when upgrade to umbraco 13 LTS

    XPathValue must be an XPathNavigator or a string

    enter image description here

    Any help. Thank you!

  • Vidar Solberg 7 posts 145 karma points
    Jan 10, 2024 @ 12:33
    Vidar Solberg
    100

    Hi Marcus

    Edit: I was too quick, and now see that you use .ContentSingleAtXPath(string xpath) in your code. Maybe there are some alternative for dynamic roots? Anyway, XPath is only obsolete in version 13, so I think this can be considered as a bug in Umbraco.

    We got this same error, but from inside Umbraco backoffice. It appeared in the UX when opening a node/document containing a Multinode Treepicker with an XPath query. As far as I can see, Umbraco 13 don't handle the "old"/depricated XPath Queries (string). The solution for us was to convert the XPath queries to Dynamic Root Queries, as shown in the screenshot.

    More about this in the Umbraco documentation.

    And I guess this may be the case for the document you're trying to render or process as well.

    -Vidar

    Umbraco Multinode Treepicker with Dynamic Root Query defined.

  • Simon steed 374 posts 686 karma points
    Jan 31, 2024 @ 16:20
    Simon steed
    0

    Did you get to the bottom of this error? I've just had it on an upgrade from 10.8.3 -> 13.1

  • Marc Goodson 2141 posts 14344 karma points MVP 8x c-trib
    Feb 02, 2024 @ 09:23
    Marc Goodson
    0

    For me it was the // in the XPATH, if I made it / path it worked

    https://github.com/umbraco/Umbraco-CMS/issues/15647

    but going to convert to Dynamic Root anyway, as V14, XPATH goes completely.

  • Kåre Mai 29 posts 207 karma points
    Feb 02, 2024 @ 08:08
    Kåre Mai
    0

    For now i've solved it with this solution:

    .ContentAtRoot().SingleOrDefault(x => x.Name == "Name of content");

    This seems wrong as it will first pull ALL content at the root level and then single out the one content node you want.

    Maybe someone knows the proper replacement for the old xpath version.

    Seems weird that the developers will just remove xpath without giving any alternative solutions!

Please Sign in or register to post replies

Write your reply to:

Draft