Ah, well maybe it's the cache has not been updated, I have come across a few cache issues in Umbraco.
Is there any reason you are using DynConfig rather than getting the image from a root document or manually? I assume it is a placeholder when you do not have an image?
I avoid using anything that accesses cache or unmanaged (by user) variables like content numbers directly.
So I would strongly recommend throwing anything to do with DynConfig in the rubbish. If you always have the image to use as a replacement in a certain area, then you could always access it directly ie: <img src="~/images/missingImage.png" />
Typically if I hit a major cache issue and it is not me trying to access any cache directly, then I republish the entire site from the Umbraco backoffice, as this clears out the caches.
In regards to avoiding the use of cache and one-time locations, for example if I was looking for a node in the base of my content tree I would use something like below:
var root = Umbraco.TypedContentAtRoot().First(x=>x.DocumentTypeAlias == "[Document typename I am looking for]")
it may be tempting to use var root = Umbraco.Content([node id]) but this means if you transfer any of this information to a different website, it will not work as the id numbers will be changed, whereas the method I have put in above will still work as the document type will not change in name.
Incorrect Syntax near '=' issue while reading Typed Media | CMS Version 7.2.0
The lines 21 & eventually 31 has the below call to typed Media: Umbraco.TypedMedia(imageId)
Hi Nitesh
Can you show the code of file: ~/Views/MacroPartials/HomePromoBanners/HomePromoBannersMacro.cshtml
Alex
Hi Alex,
Below is the complete code:
Error happens in below particular code section:
Any Updates Alex ?
Hi Nitesh
Did you solve this issue?
Hi Nitesh
What is in "DynConfig.Item("Site/DefaultImage/IdNoPhoto")" value?
Is the function returning an
int
or anint?
?If it does not return an
int?
then it cannot = null and you will get a syntax error.Have you tried testing the DynConfig with the parameter entered separate of this function?
Hi Alex and Damien,
No, this issue still exists.
The line >> DynConfig.Item("Site/DefaultImage/IdNoPhoto") returns an ID ( as a string type ) of a default image to use.
I have cross checked and it doesn't returns any NULL, or Empty and Neither 0 [ Zero], but the correct ID of the image uploaded to Umbraco.
Also, to add further, this issue occurs whenever we upload a new media and attach it to one of our page in CMS, and publish the page.
In the logs shared above, there is this below line:
Is thjere anything I also need to do for PublishedMediaCache ?
Ah, well maybe it's the cache has not been updated, I have come across a few cache issues in Umbraco.
Is there any reason you are using DynConfig rather than getting the image from a root document or manually? I assume it is a placeholder when you do not have an image?
Hi Damien,
Correct, DynConfig is used as a placeholder when an Image is not found.
You mentioned yu have faced Cache issue in umbraco. So, Please let me know what steps you usually try to fix it ?
I avoid using anything that accesses cache or unmanaged (by user) variables like content numbers directly.
So I would strongly recommend throwing anything to do with DynConfig in the rubbish. If you always have the image to use as a replacement in a certain area, then you could always access it directly ie:
<img src="~/images/missingImage.png" />
Typically if I hit a major cache issue and it is not me trying to access any cache directly, then I republish the entire site from the Umbraco backoffice, as this clears out the caches.
In regards to avoiding the use of cache and one-time locations, for example if I was looking for a node in the base of my content tree I would use something like below:
it may be tempting to use
var root = Umbraco.Content([node id])
but this means if you transfer any of this information to a different website, it will not work as the id numbers will be changed, whereas the method I have put in above will still work as the document type will not change in name.is working on a reply...