Post by SpannerMagnet » Thu Jan 06, 2022 11:51 pm

I've recently upgraded OpenCart from version 1.5.4 to 2.0.3.1. Everything appears to be working except for the Image Manager functionality.
When I upload a new picture, to a specific product, a pop-up window says "success". However, whenever I return to the Image manager window, the icon/picture isn't displaying - just the name of the file. If I open up web developer tools, the request for the image is returning a 404 error too.

Oddly, the image is present on the host cPanel's file viewer under .../store/image/catalogue.

Any tips will be appreciated :)

New member

Posts

Joined
Thu Dec 06, 2012 7:55 pm

Post by xxvirusxx » Thu Jan 06, 2022 11:59 pm

SpannerMagnet wrote:
Thu Jan 06, 2022 11:51 pm
I've recently upgraded OpenCart from version 1.5.4 to 2.0.3.1.
Why not 2.3.0.2? or 3.0.3.8

My Converted Modules | Opencart Upgrade Service | Free Dashboard Maps | Buy me a beer | My Custom OC 3.0.3.8


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by SpannerMagnet » Fri Jan 07, 2022 12:02 am

xxvirusxx wrote:
Thu Jan 06, 2022 11:59 pm
Why not 2.3.0.2? or 3.0.3.8
Hi xxvirusxx,
Erm I believe I chose that version as it was the latest version that was supported by a specific payment extension - but I don't think that is in use.
Is there a known issue with 2.0.3.1?

New member

Posts

Joined
Thu Dec 06, 2012 7:55 pm

Post by xxvirusxx » Fri Jan 07, 2022 12:04 am

Possible 2.0.3.1 use another structure for config files.
What payment you use?

My Converted Modules | Opencart Upgrade Service | Free Dashboard Maps | Buy me a beer | My Custom OC 3.0.3.8


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by SpannerMagnet » Fri Jan 07, 2022 12:15 am

xxvirusxx wrote:
Fri Jan 07, 2022 12:04 am
Possible 2.0.3.1 use another structure for config files.
What payment you use?
Just using standard PayPal now. The extension wasn't needed in the end.
Hoping to fix this without having to upgrade again :-\

New member

Posts

Joined
Thu Dec 06, 2012 7:55 pm

Post by ADD Creative » Fri Jan 07, 2022 1:36 am

Is it a resized image, one with the size added to the filename, that isn't loading?

Have you checked both your OpenCart and PHP error logs?

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by SpannerMagnet » Sat Jan 08, 2022 12:10 am

Failed to load resource: the server responded with a status of 404 () copper%20368a%20small-100x100.jpg
Yeah it looks like a resized image.
I don't see anything relating to images in the OpenCart error log:
2021-12-27 16:45:42 - PP_STANDARD :: RECEIVER EMAIL MISMATCH! admin@proactionsport.co.uk
2021-12-29 15:09:02 - PHP Notice: unserialize(): Error at offset 0 of 2 bytes in /customers/2/9/1/proactionsport.co.uk/httpd.www/store/system/library/cart.php on line 174
2021-12-29 15:09:02 - PHP Warning: Undefined array key "product_id" in /customers/2/9/1/proactionsport.co.uk/httpd.www/store/system/library/cart.php on line 176
2021-12-29 15:09:02 - PHP Notice: unserialize(): Error at offset 0 of 2 bytes in /customers/2/9/1/proactionsport.co.uk/httpd.www/store/system/library/cart.php on line 174
2021-12-29 15:09:02 - PHP Warning: Undefined array key "product_id" in /customers/2/9/1/proactionsport.co.uk/httpd.www/store/system/library/cart.php on line 176
2021-12-29 15:09:02 - PHP Notice: unserialize(): Error at offset 0 of 2 bytes in /customers/2/9/1/proactionsport.co.uk/httpd.www/store/system/library/cart.php on line 174
2021-12-29 15:09:02 - PHP Warning: Undefined array key "product_id" in /customers/2/9/1/proactionsport.co.uk/httpd.www/store/system/library/cart.php on line 176
I don't see any error log on my host's cPanel.

New member

Posts

Joined
Thu Dec 06, 2012 7:55 pm

Post by Gergely » Sat Jan 08, 2022 12:38 am

Hi SpannerMagnet,

Failed to load resource: the server responded with a status of 404 () copper%20368a%20small-100x100.jpg
Have you tried with a filename that doesn't include spaces? Although they really shouldn't, spaces in filenames still can cause problems...

Hope this is helpful,
Gergely

Active Member

Posts

Joined
Wed Sep 30, 2020 7:58 pm

Post by Gergely » Mon Jan 10, 2022 7:54 pm

Gergely wrote:
Sat Jan 08, 2022 12:38 am
Hi SpannerMagnet,

Failed to load resource: the server responded with a status of 404 () copper%20368a%20small-100x100.jpg
Have you tried with a filename that doesn't include spaces? Although they really shouldn't, spaces in filenames still can cause problems...

Hope this is helpful,
Gergely
UPDATE: I have taken a closer look and have a few observations.
  • The file you need is indeed reachable on https://proactionsport.co.uk/store/imag ... 0small.jpg, and other files with spaces in the name are loading without a problem, so spaces (alone) might not be an issue.
  • All product images I checked on your site are in the image/data folder, not in image/catalog. Did you rename the data folder to catalog after upgrading? The updater should do this automatically, but I don't know what method you used to update. There are some hardcoded checks in the file manager controller for the 'catalog' folder in the path. I didn't follow through the whole logic to check where this might in fact cause an issue, but this seems like a plausible cause for failure.
  • There are images on your site where the resized, cached version is also rotated by 90 degrees. I'm not familiar 1.5.4, so I don't know if this was a known bug, or if it included such features, or if you have been using an extension to achieve this? If it's the latter it might be worthwhile to look into the configuration of that extension as well. (Maybe it's set to operate on a certain folder? This is just a wild-wild guess though.) (An example for such an image: original, rotated.)
I know these are all a bit vague, but it probably boils down to an incorrectly executed update. All in all, updating across major versions is a messy business, and it's usually cleaner to rebuild your system on a clean install of the new version, then migrate the data with the help of a free export/import extension. This way you can keep your old store running while you figure out all the issues in the new version. If you're not too committed to this iteration yet, it might be worthwhile to try again with this method.

Active Member

Posts

Joined
Wed Sep 30, 2020 7:58 pm

Post by SpannerMagnet » Tue Jan 11, 2022 7:49 pm

Thanks for the response, Gergely!
Gergely wrote:
Mon Jan 10, 2022 7:54 pm
All product images I checked on your site are in the image/data folder, not in image/catalog. Did you rename the data folder to catalog after upgrading? The updater should do this automatically, but I don't know what method you used to update. There are some hardcoded checks in the file manager controller for the 'catalog' folder in the path. I didn't follow through the whole logic to check where this might in fact cause an issue, but this seems like a plausible cause for failure.
As far as I'm aware, I upgraded directly from 1.5.4 to 2.0.3.1 using the steps in the readMe.txt file that came within the OpenCart 2.0.3.1 download.
There were a couple of small fixes to apply after, like making sure the user had full admin rights etc - but no crazy hacks.

Gergely wrote:
Mon Jan 10, 2022 7:54 pm
There are images on your site where the resized, cached version is also rotated by 90 degrees. I'm not familiar 1.5.4, so I don't know if this was a known bug, or if it included such features, or if you have been using an extension to achieve this? If it's the latter it might be worthwhile to look into the configuration of that extension as well. (Maybe it's set to operate on a certain folder? This is just a wild-wild guess though.) (An example for such an image: original, rotated.)
Nah, there's no extension installed to rotate images. This must've been something that 1.5.4 was doing. Mind of it's own! :D

Gergely wrote:
Mon Jan 10, 2022 7:54 pm
I know these are all a bit vague, but it probably boils down to an incorrectly executed update. All in all, updating across major versions is a messy business, and it's usually cleaner to rebuild your system on a clean install of the new version, then migrate the data with the help of a free export/import extension. This way you can keep your old store running while you figure out all the issues in the new version. If you're not too committed to this iteration yet, it might be worthwhile to try again with this method.
Essentially I have upgraded this on behalf of a friend (who knows very little about computers ;D ). They've been using this new version now for a couple of months. This is the only bug they have encountered so far. I figured it was a permissions issue or perhaps something missing/wrong with one of the config.php files?

New member

Posts

Joined
Thu Dec 06, 2012 7:55 pm

Post by SpannerMagnet » Thu Jan 13, 2022 7:42 pm

Any ideas on how to resolve this?

New member

Posts

Joined
Thu Dec 06, 2012 7:55 pm

Post by ADD Creative » Thu Jan 13, 2022 8:56 pm

When you upload a new image do you see file on your server under .../store/image/catalogue/newimage.jpg?
Do you also see the .../store/image/cache/catalogue/newimage-100x100.jpg resized image?

Did you find your PHP error log (not the OpenCart one)? Maybe error_log in admin. Or ask your hot or use php_info() to find the location.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by Gergely » Fri Jan 14, 2022 6:58 pm

SpannerMagnet wrote:
Thu Jan 13, 2022 7:42 pm
Any ideas on how to resolve this?
Well, at this point, without further access / information the only thing I can provide is more guesses.
  • Do you have the correct write permissions on the image, catalog and cache folders? Opencart needs to be able to write to the image/cache folder (and subfolders).
  • If this has been working so far without problems, as you say, have there been any changes on the hosting side that might have effected this change in behaviour? Perhaps they upgraded the php version? Perhaps running low on storage space? Try to find the php error log as suggested before, check storage availability on server.
  • Did you cross check the DIR_IMAGE definitions in the config files with the actual paths? DIR_IMAGE should be the full real path to the image directory.
Please share your findings with us, and someone might be able to provide more specific suggestions.

@ADD Creative: the image this thread was started with is available under /image/catalog/copper%20368a%20small.jpg, but I couldn't load any sized version from the cache folder (by manually constructing the url working with other examples from the same site)

Active Member

Posts

Joined
Wed Sep 30, 2020 7:58 pm
Who is online

Users browsing this forum: No registered users and 2 guests