Jump to content

Product Images not shown (url.com/img/.jpg) and Undefined offset Exception


SIWA_Fabian

Recommended Posts

Hey guys!

I got a problem with my Product images.

They all get 404 Errors and the links look strange:

image.png.c6dd93bc1509d2b9777f11f20e9c5c23.png

This what the src looks like just in case you can't find it in the screenshot:
https://oetscher.local.siwa.vpn/4895-home_default/.jpg

Even enabling and Disabling the SEO-Urls doesn't help, it worked bevore than i activated the urls at one point and this happened.

The Products get imported by a custom importer. The part which imports the pictures looks like this:

 try{
     $product->addToCategories($categoryIDs);

     productImageImport($product->id, $imagename, true);
}catch (Exception $e){
     var_dump($e->getMessage());
     var_dump("at");
     var_dump($line[12]);
}

Errors were not thrown.

To Assign my Images to certain variants i just write into the database itself:

foreach ($combinationImageIds as $combinationImageId){
   if (is_numeric($combinationImageId)){
        Db::getInstance()->insert(
        'product_attribute_image',
        array(
          'id_product_attribute' => $productAttributeId,
          'id_image' => $combinationImageId
        )
     );
   }
}

 

When enable debug mode this page is shown:

image.thumb.png.08abbd1685805c29b08db5d1aa30f52b.png

 

I really need your help asap.

Thanks in advance!

Best regards Fabian

Link to comment
Share on other sites

The ContextError is solved now.
But it didn't change anything with the images.

I just rolled back to a earlier version of my shop and this solved the Exception and now the Pictures are shown in "ugly-URL-Mode" at least.
But still the strange ".jpg" when SEO-Url is enabled.

Link to comment
Share on other sites

  • 5 months later...
On 3/13/2021 at 10:07 PM, Antakarana said:

what do you mean by "I forgot to import the link_rewrite"? please can you explain?

thanks

This Column in the ps_product_lang table was not set:
image.png.4e147cbf8347a680506609a6d84ca32f.png

 

The value of this column is used to create the seo-url of a product and therefore the name of the image.
Which is why the images were called .jpg without a name, because this column was empty.

Link to comment
Share on other sites

En 15/3/2021 a las 7:33 AM, SIWA_Fabian dijo:

This Column in the ps_product_lang table was not set:
image.png.4e147cbf8347a680506609a6d84ca32f.png

 

The value of this column is used to create the seo-url of a product and therefore the name of the image.
Which is why the images were called .jpg without a name, because this column was empty.

thanks for the explanation. 

In my case the column is plenty of data so I guess it is not the origin of my issue... ☹️

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...