Describe the bug
After a new install of the branch develop, we have a new exception in the FO, this exception is displayed only when debug mode is enabled.
To Reproduce
Steps to reproduce the behavior:
git clone https://github.com/PrestaShop/PrestaShop.git
Composer install
make install
If you disable the debug mode => FO is well working!
Additional information
PrestaShop version: develop
PHP version: 7.2.22
I had the same issue. looks like there are no data in ps_image_type after fresh installation and in ImageRetriever.php file line 271 it tries to access $urls[$keys[0]]. but $keys is empty because there are no image types in ps_image_type table.
I solved this by adding a row in the table manually then error was solved.
I had the same issue. looks like there are no data in ps_image_type after fresh installation and in ImageRetriever.php file line 271 it tries to access $urls[$keys[0]]. but $keys is empty because there are no image types in ps_image_type table.
I solved this by adding a row in the table manually then error was solved.
Thanks for the tip
I have same error after instalation. No any types in ps_image_type.
running below sql fixed the issue for me:
INSERT INTO `{PREFIX}_image_type` (`id_image_type`, `name`, `width`, `height`, `products`, `categories`, `manufacturers`, `suppliers`, `stores`)
VALUES
(10, 'large_banner', 960, 400, 0, 1, 0, 0, 0),
(9, 'product_listing', 220, 220, 1, 1, 1, 1, 0),
(8, 'category_default', 960, 350, 0, 1, 0, 0, 0),
(7, 'home_default', 250, 250, 1, 0, 0, 0, 0),
(6, 'large_default', 500, 500, 1, 0, 0, 0, 0),
(5, 'medium_default', 300, 300, 1, 1, 1, 1, 0),
(4, 'small_default', 125, 125, 1, 1, 1, 1, 0),
(3, 'cart_default', 80, 80, 1, 0, 0, 0, 0);
Reproduced today by @zuk3975 (still struggling with it)
I tried too. 1st install I so the bug (both empty SQL table and broken FO). Then did a reinstall and it worked (so 2nd attempt => OK).
Strange 馃
I get the same error too..
I use steps described in devdocs: "How to become a Core Contributor using Docker".
Everytime:
docker-compose down -v
docker system prune -a
reseting my fork to the latest upstream from Prestashop/Prestashop
git fetch ps
git reset --hard ps/develop
git push origin develop
I remove PrestaShop directory from Mac OS 10.12 system (node version: v11.14.0)
git clone https://github.com/preston/PrestaShop.git
cd PrestaShop
docker-compose up
P.S. Also everytime I have to use make assets
cause there is no styling, is this like it should be?
May be we should add another script to https://github.com/PrestaShop/PrestaShop/blob/develop/Makefile in order to add this missing {PREFIX}_image_type
entries.
https://github.com/PrestaShop/PrestaShop/blob/develop/Makefile
Maybe a good idea, wdyt @PierreRambaud ?
P.S. Also everytime I have to use
make assets
cause there is no styling, is this like it should be?
Yes we think it's better not to commit assets, see https://build.prestashop.com/news/open-question-not-commiting-assets-anymore/
New occurence of the bug, I reinstall, bug is gone. Like it has been said before, my SQL table ps_image_type
was empty
Would it be worth it to at least provide a well-described error for developer ?
public function getNoPictureImage(Language $language)
{
$urls = [];
$type = 'products';
$image_types = ImageType::getImagesTypes($type, true);
if (empty($image_types)) {
throw new SomeLoveException('Hey there my friend ! It seems there is no image_type available for products and that looks like bug https://github.com/PrestaShop/PrestaShop/issues/17725, so maybe you want to reinstall your shop or manually fill the ps_image_type SQL table ?';
}
wdyt @PrestaShop/prestashop-core-developers
After execute query of, this link solution working fine for me.
https://github.com/PrestaShop/PrestaShop/issues/17725#issuecomment-616215788
It's maybe due to a wrong dependency in the XML files during the installation?
Hi! I've been able to reproduce this error and it looks like it happens when you run the installer before (or while) building the assets (with make assets
). The reason is that if the assets of the FO theme are not built, 2 required files are missing and the theme is considered invalid. As the table image_type
is filled from the theme configuration file, the table cannot be populated.
@gadnis I think your docker is using some cache from the previous script docker_run_git.sh
because the version in the develop
branch compile the assets automatically before running the installer.
Most helpful comment
I had the same issue. looks like there are no data in ps_image_type after fresh installation and in ImageRetriever.php file line 271 it tries to access $urls[$keys[0]]. but $keys is empty because there are no image types in ps_image_type table.
I solved this by adding a row in the table manually then error was solved.