Copied to clipboard

Flag this post as spam?

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


  • Danny Blatant 91 posts 358 karma points
    Jun 29, 2015 @ 10:17
    Danny Blatant
    0

    Site Restored, Media working fine in admin ID's wrong on front end

    Hi all,

    Any advise for a rather peculiar problem?

    We've had to restore a site and had some limited success, however one major issue is that media images used in the CMS, which work 100% in the control panels (can be selecteded, browsed with Media manager ect) are not showing up on the templates.

    To dealve deaper I've inspected theimage preview in the Control Panel, gleaned the ID from the filepath (lets say 1010), checked the file in the media directory. However reloading the front view of the site results in no image.

    I outputted the image ID I'm trying to load on the template, and I find its incorrect ( 1201 ). SO I've tried to refresh caches (ad nausium). I have tried :

    • Republish site via Control Panel
    • Force republish via manual TEMP and umbraco.config delete
    • Complete clearence of the App_Data/cache folder
    • Re-publishing the specific node, including removing and re-adding the image.
    • Disabling ClientDependancy
    • Recycling the AppPool

    Nothing I do seems to make the template and html output correct! The code I'm using to get the ID, and load the image is :

    //link is aniterator for an archetype, however this issue affects 
    //images not in archetypes too
    

    Please, any suggestions?? @link.GetValue("image") //returns incorrect ID @Umbraco.Media(link.GetValue("image")).Url //returns nothing

    It's like the node loaded by the Admin panels is not the same as the one being loaded on the site.

    Ammendum : It seems the Media Library is totally out of kilter with the files... The working files even have mis-reported ID's in the Admin Pages, its just the actual file is in the correct place... Is there any way to rebuild media from the files on the system?

  • Mike Chambers 636 posts 1253 karma points c-trib
    Jun 29, 2015 @ 10:44
    Mike Chambers
    0

    Try rebuilding the examine indexes.

  • Danny Blatant 91 posts 358 karma points
    Jun 29, 2015 @ 11:19
    Danny Blatant
    0

    HI,

    Thanks for the quick reply, however I have rebuild the examine indixes (multiple times). These indexes are cached in the App_Data/TEMP/ExamineIndexes folder, as I mentioned above I have cleared this folder numerous times (in fact after each iteration of each debug).

    I have done this again regardless, and disabled ClientDependancy in the web.config (although this effects CSS and Scripts more than images of course). To no avail...

    Have you any further ideas?

    Does anyone have intimate knowledge of how media is stored in the umbraco Databases? I had a look but its not quite obvious, any help being able to debug the media ID's and logic through the database would be helpful as I could trace a few of the broken images myself...

  • Mike Chambers 636 posts 1253 karma points c-trib
    Jun 29, 2015 @ 12:42
    Mike Chambers
    0

    If you check the umbraco.config file does the XML match you correct or incorrect "link" ids?

  • Anthony Chudley 50 posts 197 karma points
    Jun 29, 2015 @ 12:55
    Anthony Chudley
    0

    Only thing to be aware of is the number in the media folder is not equivalent to the ID in the DB.

    So I wouldn't be surprised that the ID being output from a media picker is different to that in the path.

    The @link.GetValue("image") is probably returning the correct ID. Although I can't be sure why the @Umbrco.Media(link.GetValue("image")).Url is returning nothing.

  • Danny Blatant 91 posts 358 karma points
    Jun 29, 2015 @ 12:59
    Danny Blatant
    0

    Hi all,

    I've made some progress here, but its far from 'optimal', I've worked out that if the image shows in the CMS but not on the front end, you can then locate the media file in the Media section of the CMS (not that easy if you have hundreds of files in many directories) then save it (re-save it basically) it seems to touch the cache responsivble and the image starts working again.

    Any thoughs on how I can do this for every image quickly?

  • Mike Chambers 636 posts 1253 karma points c-trib
    Jun 29, 2015 @ 13:20
Please Sign in or register to post replies

Write your reply to:

Draft