Copied to clipboard

Flag this post as spam?

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


  • Thomas Brinegar 84 posts 162 karma points
    Dec 02, 2014 @ 14:44
    Thomas Brinegar
    0

    GetMedia Not Working with Upgrade to 7.1.9

    Just recently upgraded the development site to version 7.1.9 from a 7.0.X instance. I've noticed that umbraco.library:GetMedia in XSLT is no longer working. I've attempted to just get the output in a value-of statement, but this is returning empty.

    When I output just the property itself, I am getting the media ID so I am certain that it is getting passed to the GetMedia method. Anyone else experiencing this?

    Examples:

    <xsl:value-of select="$currentPage/firstContentImage" />

    Returns ID of media node.

    <xsl:value-of select="umbraco.library:GetMedia($currentPage/firstContentImage, 0)/umbracoFile" />

    Empty output.

    <img src="{umbraco.library:GetMedia($currentPage/firstContentImage, 0)/umbracoFile}" alt="{$currentPage/seoPageTitle} Graphic" title="" />

    Src attribute is empty.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Dec 02, 2014 @ 15:19
    Jan Skovgaard
    1

    Hi Thomas

    Does it change anything if you change 0 to 1? It should then give you the full XML if you have for instance selected a folder containing medias etc. But just try to see if it returns anything when that param is changed.

    If you make a copy-of like below do you then get any XML returned?

    <textarea>
    <xsl:copy-of select="umbraco.library:GetMedia($currentPage/firstContentImage, 1)/umbracoFile" />
    </textarea>
    

    If not I think you should report this as a bug on the issue tracker.

    Looking forward to hearing from you.

    /Jan

  • Thomas Brinegar 84 posts 162 karma points
    Dec 02, 2014 @ 15:25
    Thomas Brinegar
    1

    Thanks for the reply Jan.

    Changing the second parameter doesn't appear to make a difference. I get some whitespace output in the textarea, but that's about it. I'll report the issue, thanks!

    http://issues.umbraco.org/issue/U4-5925

  • Dan Okkels Brendstrup 101 posts 197 karma points
    Dec 03, 2014 @ 15:03
    Dan Okkels Brendstrup
    2

    A sad testament to the perception of XSLT at the HQ that this has slipped through release testing :-/

  • Peter Gregory 408 posts 1614 karma points MVP 3x admin c-trib
    Dec 11, 2014 @ 07:53
    Peter Gregory
    0

    I just had a pull request to fix this accepted. It will be in 7.2.1 https://github.com/umbraco/Umbraco-CMS/pull/587

Please Sign in or register to post replies

Write your reply to:

Draft