Developer forum

Forum » Dynamicweb 9.0 Upgrade issues » Default image not visible

Default image not visible

Niklas Hjort
Reply

Hi Dynamicweb forum

I have recently upgraded a solution of our to 9.13.2

After the upgrade the default image (PIM) on many different products are not visible on the frontend and in the product feed. The customer is also using the image pattern feature and this feature still works.

For example see the image below (frontend):

 

 

But when i look inside the administration the default image is present:

PIM:

Ecom:

 

I have the following helper function for getting the path:

@functions {
    public string GetProductImage(LoopItem productObject = null)
    {
        string theImage = "";

        if (productObject == null) {
            theImage = GetString("Ecom:Product.ImageDefault.Default.Clean");
            theImage = String.IsNullOrEmpty(theImage) ? GetString("Ecom:Product.ImageLarge.Clean") : theImage;
            theImage = String.IsNullOrEmpty(theImage) ? GetString("Ecom:Product.ImageMedium.Clean") : theImage;
            theImage = String.IsNullOrEmpty(theImage) ? GetString("Ecom:Product.ImageSmall.Clean") : theImage;
            theImage = String.IsNullOrEmpty(theImage) ? GetString("Ecom:Product.ImageLarge.Default.Clean") : theImage;
        } else {
            theImage = productObject.GetString("Ecom:Product.ImageDefault.Default.Clean");
            theImage = String.IsNullOrEmpty(theImage) ? productObject.GetString("Ecom:Product.ImageLarge.Clean") : theImage;
            theImage = String.IsNullOrEmpty(theImage) ? productObject.GetString("Ecom:Product.ImageMedium.Clean") : theImage;
            theImage = String.IsNullOrEmpty(theImage) ? productObject.GetString("Ecom:Product.ImageSmall.Clean") : theImage;
            theImage = String.IsNullOrEmpty(theImage) ? productObject.GetString("Ecom:Product.ImageLarge.Default.Clean") : theImage;
        }

        return theImage;
    }
}

The settings for the product images are as follow:


Replies

 
Oleg Rodionov Dynamicweb Employee
Oleg Rodionov
Reply

Hi,

Ensure the option pointed in the attached pic is checked. The tag is enabled and filled correctly with the settings on last DW9.13.3 at least. Refer to the manual for details. 

BR, Oleg QA 

2022-03-28_09-56-25.png
 
Niklas Hjort
Reply

Hi Oleg

I have checked the following:

However it still does not render the image on the frontend:

 
Stanislav Smetanin Dynamicweb Employee
Stanislav Smetanin
Reply

Hi Niklas,
Could you please write here your Ecommerce, Dynamicweb package version numbers?
I can't reproduce your problem, but probably this is because that it was already fixed in the latest Ecommerce-Dynamicweb packages. We can start with checking this and move forward if something is still wrong.

The GetProductImage which you use is a standard function from Rapido templates, and it should be ok. So my guess is that you need to update Ecommerce (probably only Ecommerce, nothing else) package. 

Kind regards.

 
Niklas Hjort
Reply

Hi Stanislav

The installed ecommere package is:

Version: "1.13.14".

Thanks for the help so far.

 
Stanislav Smetanin Dynamicweb Employee
Stanislav Smetanin
Reply
This post has been marked as an answer

I have checked it with your Ecommerce version. Yes, on this version the problem exist.

But it is fixed if you update your Ecommerce to the latest version (1.13.29). Could you please try this?

A new version has just been released (9.13.4). You also could try to upgrade your solution to the latest version and see if that helps. It should already has Ecommerce 1.13.29 in its bin folder, so this is also the way to solve your problem.

Votes for this answer: 1
 
Scott Forsyth Dynamicweb Employee
Scott Forsyth
Reply

Niklas,

Another thing to confirm is that the GetImage handler is working. Somewhere in 9.12.x, there was a new version of System.Drawing.Common, from 4.0.0.1 to 4.0.0.2. If you didn't include the assembly reference in web.config in the upgrade (if you came from a version prior to that change), then it will fail. Because it's an http handler, you may not notice until an image is called. In other words, it doesn't break the whole site, it only breaks the images.

You can confirm by right-clicking on the image in your browser (frontend) and open the image in a new tab. Then see if you get a 404 or an exception message. If so, it's most likely from that. You can turn on detailed error messages in IIS to know for sure, if you're curious. 

To solve it, add the following to your <runtime /> section, beside the other similar entries:

      <dependentAssembly>
        <assemblyIdentity name="System.Drawing.Common" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.0.0.1" newVersion="4.0.0.2" />
      </dependentAssembly>

 

 
Niklas Hjort
Reply

I upgraded the entire solution to DW 9.13.3 and it solved the problem. Also i upgraded the eccommerce. Thanks for the help.

 

You must be logged in to post in the forum