Copied to clipboard

Flag this post as spam?

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


  • SinkyPars 132 posts 175 karma points
    Jul 07, 2011 @ 17:41
    SinkyPars
    0

    Image cach/load inconsistency

    Hi,

    I am using this code to show an image within a template using XSLT

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

    The strange thing is this works sometimes and others not. Seems totally random.

    I am using umbraco 4.7 on a windows 2008 box.

    Any help would be much appreciated.

    Thanks

     

    Scott

  • Tim 1193 posts 2675 karma points MVP 4x c-trib
    Jul 07, 2011 @ 18:12
    Tim
    0

    What's the actual error you're getting? Are you sometimes getting a broken image? Or is it displaying an error message? Is the XSLT Macro being cached?

  • SinkyPars 132 posts 175 karma points
    Jul 07, 2011 @ 18:38
    SinkyPars
    0

    Hi Tim,

    I get no error. Simply some times it shows but a few times it doesnt. When I then republish the site its fine.

    Here are my cache details:

    Cache Period: 0

    Cache By Page: Yes

    Cache Personalized: No

    Just the defaults I think.

    Does the cache by page make a difference to the get image?

    Thanks

    Scott

  • Tim 1193 posts 2675 karma points MVP 4x c-trib
    Jul 08, 2011 @ 09:48
    Tim
    0

    Wierd! I've sometimes had problems with images disappearing on macros that were cached, but your caching settings look fine. I'm not really sure what the issue could be. If you have access to the server logs, you could have a look and see if there are any errors relating to the images that aren't displaying?

  • SinkyPars 132 posts 175 karma points
    Jul 08, 2011 @ 11:35
    SinkyPars
    0

    Yeah it is a strange one. I may turn off cacheing all together to see if that fixes the issue.

    Quiet simply when I request an image it will show. If I then refresh there is a chance the image will dissapear. I'll come back an hour later and theres a chance it will be displaying :S

     

    S

  • Tim 1193 posts 2675 karma points MVP 4x c-trib
    Jul 08, 2011 @ 11:42
    Tim
    0

    It might be worth having a look in the umbracoLog table and see if anything is in there relating to the images?

  • SinkyPars 132 posts 175 karma points
    Jul 08, 2011 @ 12:44
    SinkyPars
    0

    I have quiet alot of:

     

    Error adding to SiteMapProvider: System.InvalidOperationException: Multiple nodes with the same URL '/' were found. XmlSiteMapProvider requires that sitemap nodes have unique URLs.     at System.Web.StaticSiteMapProvider.AddNode(SiteMapNode node, SiteMapNode parentNode)     at umbraco.presentation.nodeFactory.UmbracoSiteMapProvider.loadNodes(String parentId, SiteMapNode parentNode)

    Error adding to SiteMapProvider: System.InvalidOperationException: Multiple nodes with the same URL '/' were found. XmlSiteMapProvider requires that sitemap nodes have unique URLs.     at System.Web.StaticSiteMapProvider.AddNode(SiteMapNode node, SiteMapNode parentNode)     at umbraco.presentation.nodeFactory.UmbracoSiteMapProvider.loadNodes(String parentId, SiteMapNode parentNode)

     

    In the log :S I dont know if this affects images though

     

    Also a few:

     

    At /media/1346/www.test.com/media/1346/www.test.com/media/1346/www.test.com/media/1346/www.test.com/media/1346/www.test.com/media/1346/www.test.com/media/1346/www.test.com/media/1346/www.test.com/media/1346/www.test.com/media/1346/www.test.com/media/1346/www.test.com/media/1346/www.test.com/media/1346/www.test.com/media/1346/www.test.com/media/1346/www.test.com/media/1346/3.jpg (Referred by: http://www.test.com/):

     

     

     

    Thanks

     

     

     

    Scott

  • Tim 1193 posts 2675 karma points MVP 4x c-trib
    Jul 08, 2011 @ 15:20
    Tim
    0

    Hmm, looking at the log, it looks like the media is requesting the wrong URL? I can't see anything wrong with your XSLT though.......

  • SinkyPars 132 posts 175 karma points
    Jul 08, 2011 @ 18:01
    SinkyPars
    0

    Just realised I never have this probelm when accessing content/media via C# :s

    Is my media file / umbraco content file getting corrupted?

     

  • SinkyPars 132 posts 175 karma points
    Jul 08, 2011 @ 18:22
    SinkyPars
    0

    Everytime I republish the site I see the image again! :S

    Any help would be much appreciated.

    S

  • Tim 1193 posts 2675 karma points MVP 4x c-trib
    Jul 11, 2011 @ 10:05
    Tim
    0

    It could be to do with the media cache? That gets rebuilt when you republish the site I think. Maybe that's getting corrupted somehow, or lost. If you set up a clean install of Umbraco on the same box, does it display the same behaviour?

  • SinkyPars 132 posts 175 karma points
    Jul 11, 2011 @ 10:09
    SinkyPars
    0

    Ok,

    I think I have solved the probelm.

    Before I was using umbraco.library:GetMedia($inspireNode/hotelThumbNailImage, 0)/umbracoFile

    And now I am using umbraco.library:GetMedia($inspireNode/hotelThumbNailImage, '0')/umbracoFile - notcie the quotes around the '0'

    Why would this have a knock on affect sometimes and not others?

    Cheers

     

    Scott

     

  • Tim 1193 posts 2675 karma points MVP 4x c-trib
    Jul 11, 2011 @ 10:19
    Tim
    0

    That's very odd! I'd log that as a bug on Codeplex: http://umbraco.codeplex.com/workitem/list/basic

    :)

Please Sign in or register to post replies

Write your reply to:

Draft