I'm running Umbraco 7.5.9 and uCommerce 7.0.5.16060 (planning to update within a week or two). We just noticed today that four of our client's category pages (or sub-category pages) are throwing the following error, and we cannot track down what's causing it. Currently, I'm unsure of whether this is an Umbraco issue or a uCommerce issue...though it looks like it may be an Umbraco issue. This started to occur after we updated Umbraco to the latest version earlier this week.
If anyone can provide some insight into this, it would be greatly appreciated!
[If you right-click the image and open in a new window, you'll be able to read the error text.]
I've located what's causing this, but I haven't been able to determine how to check whether the mediaSource.GetCropUrl is null or not. This is the source of the error:
if (!string.IsNullOrEmpty(product.GetPropertyValue<string>("MainProductImage")))
{
//var media = ObjectFactory.Instance.Resolve<IImageService>().GetImage(product.ThumbnailImageMediaId).Url;
var media = product.GetPropertyValue<string>("MainProductImage");
var mediaSource = umbracoHelper.TypedMedia(media);
<a href="@url">
@*<img src="@mediaSource.GetCropUrl("umbracoFile", "store-product-medium")" class="main-image" />*@
</a>
}
else
{
<a href="@url">
<img class="main-image" src="~/umbraco/ucommerce/images/ui/image_not_found.jpg">
</a>
}
I'm still unsure as to why the if statement above didn't work, but using a try-catch does work. I'm posting this here in case it may help someone else who experiences this same issue:
I'm having the same issue. So this seems to be a BUG with NuCache. After a certain period my V8.0.1 website throws exactly this error.
A workaround makes no sense, because the value and mediaitem does exists. Somehow the cache gets invalid.
When i RELOAD NuCache from the Backend, the error is gone and the mediaItem "exists". I have to reload the cache several times a day.
Are there any special settings regarding nucache we have to take care of during the server setup? The AppPool\name has sufficient rights on the folders.
Value cannot be null. Parameter name: mediaItem
I'm running Umbraco 7.5.9 and uCommerce 7.0.5.16060 (planning to update within a week or two). We just noticed today that four of our client's category pages (or sub-category pages) are throwing the following error, and we cannot track down what's causing it. Currently, I'm unsure of whether this is an Umbraco issue or a uCommerce issue...though it looks like it may be an Umbraco issue. This started to occur after we updated Umbraco to the latest version earlier this week.
If anyone can provide some insight into this, it would be greatly appreciated!
[If you right-click the image and open in a new window, you'll be able to read the error text.]
I've located what's causing this, but I haven't been able to determine how to check whether the mediaSource.GetCropUrl is null or not. This is the source of the error:
Specifically, the issue is caused here:
...which is commented out above, since it's not working. I've tried to trap for the null reference like this, but it's not working either:
I'm still unsure as to why the if statement above didn't work, but using a try-catch does work. I'm posting this here in case it may help someone else who experiences this same issue:
Hi Jerritte,
Try something like
You'll need C#6. I think Umbraco also has an IfNullOrWhitespace() Extension method.
Stephano,
That's using C# 6, so I can't use that yet.
I found upgrading is usually fast and straightforward, however here is the pre C#6 way:
Stephano,
Ah...that works, and is clearly more concise! I should have known that. :)
Thanks!
I'm having the same issue. So this seems to be a BUG with NuCache. After a certain period my V8.0.1 website throws exactly this error.
A workaround makes no sense, because the value and mediaitem does exists. Somehow the cache gets invalid.
When i RELOAD NuCache from the Backend, the error is gone and the mediaItem "exists". I have to reload the cache several times a day.
Are there any special settings regarding nucache we have to take care of during the server setup? The AppPool\name has sufficient rights on the folders.
Thx in advance, Andreas
I've been getting this same problem with a new 8.0.1 install - it seems to happen after any AppPool restarts.
Rinse and repeat. I'm keen on finding a better solution to this, as well.
Confirmed that this is resolved in 8.0.2 (at least, after recycling as listed above).
Instead of
We use
And all is good! Umbraco 8.6
is working on a reply...