Copied to clipboard

Flag this post as spam?

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


  • Wayne 19 posts 59 karma points
    Oct 11, 2012 @ 02:08
    Wayne
    0

    XSLT errors since upgrading to 4.9

    Since upgrading from 4.8 to 4.9 my xslt macros have errors.

     

    I cant get it show a stack trace http://www.liveschool.net/?umbDebugShowTrace=true

     

    Is this a known issue or else what could be causing it.

    thanks

    Wayne

  • Chriztian Steinmeier 2800 posts 8791 karma points MVP 8x admin c-trib
    Oct 11, 2012 @ 08:12
    Chriztian Steinmeier
    0

    Hi Wayne,

    To get the trace output you need to set the key umbracoDebugMode to true in the web.config file.

    My guess is you're probably iterating through a bunch of nodes, calling GetMedia() to get the images - if you're doing that, make sure to assert that the the image property (or what you've named it) has a value, before calling the extension. Otherwise, a single node with no image assigned will break the page.

    You can do that in several ways, e.g.:

    <xsl:for-each select="umbraco.library:GetXmlNodeById($source)/*[@isDoc]">
        <xsl:if test="normalize-space(image)">
            <!-- Call GetMedia(image, 0) here -->
        </xsl:if>
        <!-- Other stuff for this node -->
    </xsl:for-each>

    Or if you don't want to output nodes that have no image assigned, filter them right away:

    <xsl:for-each select="umbraco.library:GetXmlNodeById($source)/*[@isDoc][normalize-space(image)]">
        <!-- Call GetMedia(image, 0) and other stuff in here  -->
    </xsl:for-each>

    /Chriztian

  • 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