pim-community-dev icon indicating copy to clipboard operation
pim-community-dev copied to clipboard

Product images are not displayed

Open bartoll opened this issue 4 years ago • 3 comments

:bug: I'm reporting a Bug :bug:

For version dev

"require": {
    "akeneo/pim-community-dev": "dev-master@dev"
},

There is a problem with displaying product images in Akeneo PIM

  1. I go to the 'Edit product' window and upload a new image for any product
  2. Upload finishes with no error
  • file is saved in var/file_storage/catalog ...
  • ajax returns new URI for this image
  1. New image is not displayed after uploading not-displayed
  2. In IDE I can see this error
Symfony\Component\Routing\Exception\ResourceNotFoundException: No routes found for "/media/show/6/7/2/3/6723fda48f6004b8d1fc82a4acc57d87cb433eda_WP_20201202_15_55_00_Pro.jpg/thumbnail_small/". in /var/www/vagrant/demo1.akeneo.local/vendor/symfony/routing/Matcher/Dumper/CompiledUrlMatcherTrait.php:70
Stack trace:
#0 /var/www/vagrant/demo1.akeneo.local/vendor/symfony/routing/Matcher/UrlMatcher.php(106): Symfony\Component\Routing\Matcher\CompiledUrlMatcher->match()
#1 /var/www/vagrant/demo1.akeneo.local/vendor/symfony/routing/Router.php(274): Symfony\Component\Routing\Matcher\UrlMatcher->matchRequest()
#2 /var/www/vagrant/demo1.akeneo.local/vendor/symfony/http-kernel/EventListener/RouterListener.php(112): Symfony\Component\Routing\Router->matchRequest()
#3 /var/www/vagrant/demo1.akeneo.local/vendor/symfony/event-dispatcher/EventDispatcher.php(304): Symfony\Component\HttpKernel\EventListener\RouterListener->onKernelRequest()
#4 /var/www/vagrant/demo1.akeneo.local/vendor/symfony/event-dispatcher/EventDispatcher.php

bartoll avatar Dec 22 '20 16:12 bartoll

I have found solution:

Akeneo displays product's image through URL like this http:/mydomain.xyz/media/show/4%252Fc%252F1%252F2%252F4c125cc21a1ddd33f9b41c68ff878935ac0626be_WP_20201202_15_54_31_Pro.jpg/thumbnail_small Akeneo prepares image and redirect (301) browser to URL like this http:/mydomain.xyz/media/cache/thumbnail_small/4/c/1/2/4c125cc21a1ddd33f9b41c68ff878935ac0626be_WP_20201202_15_54_31_Pro.jpg

In my situation first URL was not available to Akeneo app due to Apache restrictions. Default value for AllowEncodedSlashes directive is 'Off'. You should set it to 'NoDecode'. This settings should be added in virtual host context (setting it globally didn't work for me).

This information is missing in official Akeneo manual.

bartoll avatar Dec 25 '20 11:12 bartoll

I have the same issue on akeneo 4.0 after migration from 3.2...I try the solution provide by @bartoll , but not working for me

alinolandry avatar Oct 01 '21 15:10 alinolandry

We have the same problem on Akeneo 7.0 with Firefox. Running Apache server in a new installation. Images do work on Chrome though. Request to thumbnail_small returns correct location header for redirection to the media, but the transfer fails due to NS_ERROR_UNEXPECTED. Swiching AllowEncodedSlashes value makes no difference. On Chrome images work even with AllowEncodedSlashes being "Off".

petrosoft-fi avatar Feb 12 '24 10:02 petrosoft-fi