Copied to clipboard

Flag this post as spam?

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


  • Alex Reyes 10 posts 30 karma points
    Jan 07, 2014 @ 14:27
    Alex Reyes
    0

    Media/Images not showing because of missing/incorrect umbracoFile values

    Hi, I'm getting frustrated over a recurring problem with images that were previously working/displaying correctly suddenly behaving incorrectly. Here's the breakdown of the issue that I'm having:

    - Found images that were not showing in frontend. Here's the XML of that media in the database:

      <Image id="3132" version="01ef6d5c-1728-41e8-9af8-9ef4b9ad23bf" parentID="2189" level="4" writerID="3" nodeType="1032" template="0" sortOrder="4" createDate="2013-03-19T13:29:28" updateDate="2012-11-12T16:14:01" nodeName="03" urlName="03" writerName="Peter Hvidt" nodeTypeAlias="Image" path="-1,1069,1084,2189,12135">
        <umbracoFile>639</umbracoFile>
        <umbracoWidth>320</umbracoWidth>
        <umbracoHeight>84342</umbracoHeight>
        <umbracoBytes>jpg</umbracoBytes>
      </Image>

    Notice something? It seems that somewhere along the way, the properties got jumbled up. The value for the umbracoFile property is not saved, the umbracoExtension property disappeared, and all the other values got shifted to other (incorrect) properties. As a quick reminder, this is what a valid Image XML should have looked like:

      <Image id="3130" version="1d977bc9-f2de-4e85-839b-2b1b8e8334e7" parentID="2170" level="4" writerID="3" nodeType="1032" template="0" sortOrder="6" createDate="2012-11-12T15:50:59" updateDate="2012-11-12T15:51:16" nodeName="05" urlName="05" writerName="Peter Hvidt" nodeTypeAlias="Image" path="-1,1069,1084,2170,3130">
        <umbracoFile>/media/100556/05.jpg</umbracoFile>
        <umbracoWidth>4309</umbracoWidth>
        <umbracoHeight>2154</umbracoHeight>
        <umbracoBytes>4862921</umbracoBytes>
        <umbracoExtension>jpg</umbracoExtension>
      </Image>

    - Tried to search for other Images that seems to have "weird looking" values in the umbracoFile property (in the cmsContentXml table). Here's the actual script that I used:

    select cmsContentXml.* from cmsContentXml
    inner join (select nodeId from cmsContentXml where [xml] like '<Image%Image>') test on test.nodeId = cmsContentXml.nodeId
    where cmsContentXml.[xml] not like '%<umbracoFile>/media%'

    With this script, I've found more than 30 instances. I've manually checked all values and found that either the values shifted or there are no values at all. But the most surprising part of it all is that when I tried to check the said Images in the Umbraco Media tab, the images are there and working. Here's a screenshot of the Image mentioned earlier in the Media tab:

    Now... here are my questions:

    [1] What is causing this erratic behavior?

    [2] I've already tried the republish with the xml querystring set to 'true' (btw, it took a really long while due to the amount of content that we already have) but that didn't work out for us. Is there an alternative way to "rebuilding" the cmsContentXml table?

    [3] Is there also an alternative way of determining the url of an Image that does not use umbracoFile? This based on the assumption that "if Umbraco Media page can show the image when the XML does not have the umbracoFile property, the user should also be able to do just that".

    Thanks.

     

Please Sign in or register to post replies

Write your reply to:

Draft