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?
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...
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.
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?
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 :
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 :
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?
Try rebuilding the examine indexes.
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...
If you check the umbraco.config file does the XML match you correct or incorrect "link" ids?
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.
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?
https://our.umbraco.org/forum/developers/extending-umbraco/56442-Save-all-media-items-button
Any help?
is working on a reply...