Alex Posted October 24, 2017 Share Posted October 24, 2017 Bonjour, je bloque depuis ce matin sur un problème d'affichage des photos de produits. J'ai fais une installation toute fraiche de Prestashop 1.7.2.3. Quant je créé un produit, les photos de s'affichent pas dans le front office. En back office, la photo apparait dans la liste des produits, mais elle n'apparait plus dans la fiche produit. Lorsque je passe en mode debug, sur la page produit du front office, j'ai ça : ContextErrorException in ImageRetriever.php line 174: Notice: Undefined offset: 0 in ImageRetriever.php line 174 at ErrorHandler->handleError('8', 'Undefined offset: 0', '/var/home/boutiquetest/public_html/src/Adapter/Image/ImageRetriever.php', '174', array('object' => object(Product), 'id_image' => '27', 'type' => 'products', 'getImageURL' => 'getImageLink', 'root' => '/var/home/boutiquetest/public_html/img/p/', 'imageFolderPath' => '/var/home/boutiquetest/public_html/img/p/2/7', 'urls' => array(), 'image_types' => array(), 'extPath' => '/var/home/boutiquetest/public_html/img/p/2/7/fileType', 'ext' => 'jpg', 'mainImagePath' => '/var/home/boutiquetest/public_html/img/p/2/7/27.jpg', 'keys' => array())) in ImageRetriever.php line 174 at ImageRetriever->getImage(object(Product), '27') in ImageRetriever.php line 81 at ImageRetriever->PrestaShop\PrestaShop\Adapter\Image\{closure}(array('cover' => '1', 'id_image' => '27', 'legend' => '', 'position' => '1')) at array_map(object(Closure), array(array('cover' => '1', 'id_image' => '27', 'legend' => '', 'position' => '1'))) in ImageRetriever.php line 90 at ImageRetriever->getProductImages(array('id_shop_default' => '1', 'id_manufacturer' => '0', 'id_supplier' => '0', 'reference' => 'R1256', 'supplier_reference' => '', 'location' => '', 'width' => '0.000000', 'height' => '0.000000', 'depth' => '0.000000', 'weight' => '0.000000', 'quantity_discount' => '0', 'ean13' => '', 'isbn' => '', 'upc' => '', 'cache_is_pack' => '0', 'cache_has_attachments' => '0', 'is_virtual' => '0', 'state' => '1', 'id_category_default' => '2', 'id_tax_rules_group' => '1', 'on_sale' => '0', 'online_only' => '0', 'ecotax' => '0', 'minimal_quantity' => '1', 'price' => '36', 'wholesale_price' => '0.000000', 'unity' => '', 'unit_price_ratio' => '0.000000', 'additional_shipping_cost' => '0.00', 'customizable' => '0', 'text_fields' => '0', 'uploadable_files' => '0', 'redirect_type' => '404', 'id_type_redirected' => '0', 'available_for_order' => '1', 'available_date' => '0000-00-00', 'show_condition' => '0', 'condition' => 'new', 'show_price' => '1', 'indexed' => '1', 'visibility' => 'both', 'cache_default_attribute' => '0', 'advanced_stock_management' => '0', 'date_add' => '2017-10-24 11:41:24', 'date_upd' => '2017-10-24 11:43:23', 'pack_stock_type' => '3', 'meta_description' => '', 'meta_keywords' => '', 'meta_title' => '', 'link_rewrite' => 'lorem-ipsum-dolor-sit-amet', 'name' => 'Lorem ipsum dolor sit amet', 'description' => '<p>Mauris non lacus et elit congue faucibus quis quis lacus. Ut eget vestibulum nunc. Curabitur ac varius risus. Pellentesque molestie tellus massa, et venenatis nulla cursus non. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Curabitur non elit finibus, lobortis felis a, tincidunt justo. Aliquam porta lorem ut laoreet blandit. In vehicula iaculis elit, vitae mattis urna. Aliquam ac metus sit amet massa faucibus tincidunt. Donec non hendrerit dui.</p> <p>Sed et ante a velit tincidunt mattis eget quis velit.</p>', 'description_short' => '<p>Lorem ipsum dolor sit amet</p>', 'available_now' => '', 'available_later' => '', 'id' => '11', 'id_product' => '11', 'out_of_stock' => '2', 'new' => '1', 'id_product_attribute' => '0', 'quantity_wanted' => '1', 'extraContent' => array(), 'allow_oosp' => '0', 'category' => 'accueil', 'category_name' => 'Accueil', 'link' => 'http://boutiquetest.n124.mobi/accueil/11-lorem-ipsum-dolor-sit-amet.html', 'attribute_price' => '0', 'price_tax_exc' => '30', 'price_without_reduction' => '36', 'reduction' => '0', 'specific_prices' => array(), 'quantity' => '15', 'quantity_all_versions' => '15', 'id_image' => 'fr-default', 'features' => array(), 'attachments' => array(), 'virtual' => '0', 'pack' => '0', 'packItems' => array(), 'nopackprice' => '0', 'customization_required' => false, 'rate' => '20', 'tax_name' => 'TVA FR 20%', 'ecotax_rate' => '0', 'unit_price' => '0', 'customizations' => array('fields' => array()), 'id_customization' => '0', 'is_customizable' => false, 'show_quantities' => true, 'quantity_label' => 'Produits', 'quantity_discounts' => array(), 'customer_group_discount' => '0'), object(Language)) in ProductPresenter.php line 96 at ProductPresenter->fillImages(array('id_shop_default' => '1', 'id_manufacturer' => '0', 'id_supplier' => '0', 'reference' => 'R1256', 'supplier_reference' => '', 'location' => '', 'width' => '0.000000', 'height' => '0.000000', 'depth' => '0.000000', 'weight' => '0.000000', 'quantity_discount' => '0', 'ean13' => '', 'isbn' => '', 'upc' => '', 'cache_is_pack' => '0', 'cache_has_attachments' => '0', 'is_virtual' => '0', 'state' => '1', 'id_category_default' => '2', 'id_tax_rules_group' => '1', 'on_sale' => '0', 'online_only' => '0', 'ecotax' => '0', 'minimal_quantity' => '1', 'price' => '36', 'wholesale_price' => '0.000000', 'unity' => '', 'unit_price_ratio' => '0.000000', 'additional_shipping_cost' => '0.00', 'customizable' => '0', 'text_fields' => '0', 'uploadable_files' => '0', 'redirect_type' => '404', 'id_type_redirected' => '0', 'available_for_order' => '1', 'available_date' => '0000-00-00', 'show_condition' => '0', 'condition' => 'new', 'show_price' => true, 'indexed' => '1', 'visibility' => 'both', 'cache_default_attribute' => '0', 'advanced_stock_management' => '0', 'date_add' => '2017-10-24 11:41:24', 'date_upd' => '2017-10-24 11:43:23', 'pack_stock_type' => '3', 'meta_description' => '', 'meta_keywords' => '', 'meta_title' => '', 'link_rewrite' => 'lorem-ipsum-dolor-sit-amet', 'name' => 'Lorem ipsum dolor sit amet', 'description' => '<p>Mauris non lacus et elit congue faucibus quis quis lacus. Ut eget vestibulum nunc. Curabitur ac varius risus. Pellentesque molestie tellus massa, et venenatis nulla cursus non. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Curabitur non elit finibus, lobortis felis a, tincidunt justo. Aliquam porta lorem ut laoreet blandit. In vehicula iaculis elit, vitae mattis urna. Aliquam ac metus sit amet massa faucibus tincidunt. Donec non hendrerit dui.</p> <p>Sed et ante a velit tincidunt mattis eget quis velit.</p>', 'description_short' => '<p>Lorem ipsum dolor sit amet</p>', 'available_now' => '', 'available_later' => '', 'id' => '11', 'id_product' => '11', 'out_of_stock' => '2', 'new' => '1', 'id_product_attribute' => '0', 'quantity_wanted' => '1', 'extraContent' => array(), 'allow_oosp' => '0', 'category' => 'accueil', 'category_name' => 'Accueil', 'link' => 'http://boutiquetest.n124.mobi/accueil/11-lorem-ipsum-dolor-sit-amet.html', 'attribute_price' => '0', 'price_tax_exc' => '30', 'price_without_reduction' => '36', 'reduction' => '0', 'specific_prices' => array(), 'quantity' => '15', 'quantity_all_versions' => '15', 'id_image' => 'fr-default', 'features' => array(), 'attachments' => array(), 'virtual' => '0', 'pack' => '0', 'packItems' => array(), 'nopackprice' => '0', 'customization_required' => false, 'rate' => '20', 'tax_name' => 'TVA FR 20%', 'ecotax_rate' => '0', 'unit_price' => '0', 'customizations' => array('fields' => array()), 'id_customization' => '0', 'is_customizable' => false, 'show_quantities' => true, 'quantity_label' => 'Produits', 'quantity_discounts' => array(), 'customer_group_discount' => '0', 'attributes' => array(), 'weight_unit' => 'kg'), object(ProductPresentationSettings), array('id_shop_default' => '1', 'id_manufacturer' => '0', 'id_supplier' => '0', 'reference' => 'R1256', 'supplier_reference' => '', 'location' => '', 'width' => '0.000000', 'height' => '0.000000', 'depth' => '0.000000', 'weight' => '0.000000', 'quantity_discount' => '0', 'ean13' => '', 'isbn' => '', 'upc' => '', 'cache_is_pack' => '0', 'cache_has_attachments' => '0', 'is_virtual' => '0', 'state' => '1', 'id_category_default' => '2', 'id_tax_rules_group' => '1', 'on_sale' => '0', 'online_only' => '0', 'ecotax' => '0', 'minimal_quantity' => '1', 'price' => '36', 'wholesale_price' => '0.000000', 'unity' => '', 'unit_price_ratio' => '0.000000', 'additional_shipping_cost' => '0.00', 'customizable' => '0', 'text_fields' => '0', 'uploadable_files' => '0', 'redirect_type' => '404', 'id_type_redirected' => '0', 'available_for_order' => '1', 'available_date' => '0000-00-00', 'show_condition' => '0', 'condition' => 'new', 'show_price' => '1', 'indexed' => '1', 'visibility' => 'both', 'cache_default_attribute' => '0', 'advanced_stock_management' => '0', 'date_add' => '2017-10-24 11:41:24', 'date_upd' => '2017-10-24 11:43:23', 'pack_stock_type' => '3', 'meta_description' => '', 'meta_keywords' => '', 'meta_title' => '', 'link_rewrite' => 'lorem-ipsum-dolor-sit-amet', 'name' => 'Lorem ipsum dolor sit amet', 'description' => '<p>Mauris non lacus et elit congue faucibus quis quis lacus. Ut eget vestibulum nunc. Curabitur ac varius risus. Pellentesque molestie tellus massa, et venenatis nulla cursus non. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Curabitur non elit finibus, lobortis felis a, tincidunt justo. Aliquam porta lorem ut laoreet blandit. In vehicula iaculis elit, vitae mattis urna. Aliquam ac metus sit amet massa faucibus tincidunt. Donec non hendrerit dui.</p> <p>Sed et ante a velit tincidunt mattis eget quis velit.</p>', 'description_short' => '<p>Lorem ipsum dolor sit amet</p>', 'available_now' => '', 'available_later' => '', 'id' => '11', 'id_product' => '11', 'out_of_stock' => '2', 'new' => '1', 'id_product_attribute' => '0', 'quantity_wanted' => '1', 'extraContent' => array(), 'allow_oosp' => '0', 'category' => 'accueil', 'category_name' => 'Accueil', 'link' => 'http://boutiquetest.n124.mobi/accueil/11-lorem-ipsum-dolor-sit-amet.html', 'attribute_price' => '0', 'price_tax_exc' => '30', 'price_without_reduction' => '36', 'reduction' => '0', 'specific_prices' => array(), 'quantity' => '15', 'quantity_all_versions' => '15', 'id_image' => 'fr-default', 'features' => array(), 'attachments' => array(), 'virtual' => '0', 'pack' => '0', 'packItems' => array(), 'nopackprice' => '0', 'customization_required' => false, 'rate' => '20', 'tax_name' => 'TVA FR 20%', 'ecotax_rate' => '0', 'unit_price' => '0', 'customizations' => array('fields' => array()), 'id_customization' => '0', 'is_customizable' => false, 'show_quantities' => true, 'quantity_label' => 'Produits', 'quantity_discounts' => array(), 'customer_group_discount' => '0'), object(Language)) in ProductPresenter.php line 568 at ProductPresenter->present(object(ProductPresentationSettings), array('id_shop_default' => '1', 'id_manufacturer' => '0', 'id_supplier' => '0', 'reference' => 'R1256', 'supplier_reference' => '', 'location' => '', 'width' => '0.000000', 'height' => '0.000000', 'depth' => '0.000000', 'weight' => '0.000000', 'quantity_discount' => '0', 'ean13' => '', 'isbn' => '', 'upc' => '', 'cache_is_pack' => '0', 'cache_has_attachments' => '0', 'is_virtual' => '0', 'state' => '1', 'id_category_default' => '2', 'id_tax_rules_group' => '1', 'on_sale' => '0', 'online_only' => '0', 'ecotax' => '0', 'minimal_quantity' => '1', 'price' => '36', 'wholesale_price' => '0.000000', 'unity' => '', 'unit_price_ratio' => '0.000000', 'additional_shipping_cost' => '0.00', 'customizable' => '0', 'text_fields' => '0', 'uploadable_files' => '0', 'redirect_type' => '404', 'id_type_redirected' => '0', 'available_for_order' => '1', 'available_date' => '0000-00-00', 'show_condition' => '0', 'condition' => 'new', 'show_price' => '1', 'indexed' => '1', 'visibility' => 'both', 'cache_default_attribute' => '0', 'advanced_stock_management' => '0', 'date_add' => '2017-10-24 11:41:24', 'date_upd' => '2017-10-24 11:43:23', 'pack_stock_type' => '3', 'meta_description' => '', 'meta_keywords' => '', 'meta_title' => '', 'link_rewrite' => 'lorem-ipsum-dolor-sit-amet', 'name' => 'Lorem ipsum dolor sit amet', 'description' => '<p>Mauris non lacus et elit congue faucibus quis quis lacus. Ut eget vestibulum nunc. Curabitur ac varius risus. Pellentesque molestie tellus massa, et venenatis nulla cursus non. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Curabitur non elit finibus, lobortis felis a, tincidunt justo. Aliquam porta lorem ut laoreet blandit. In vehicula iaculis elit, vitae mattis urna. Aliquam ac metus sit amet massa faucibus tincidunt. Donec non hendrerit dui.</p> <p>Sed et ante a velit tincidunt mattis eget quis velit.</p>', 'description_short' => '<p>Lorem ipsum dolor sit amet</p>', 'available_now' => '', 'available_later' => '', 'id' => '11', 'id_product' => '11', 'out_of_stock' => '2', 'new' => '1', 'id_product_attribute' => '0', 'quantity_wanted' => '1', 'extraContent' => array(), 'allow_oosp' => '0', 'category' => 'accueil', 'category_name' => 'Accueil', 'link' => 'http://boutiquetest.n124.mobi/accueil/11-lorem-ipsum-dolor-sit-amet.html', 'attribute_price' => '0', 'price_tax_exc' => '30', 'price_without_reduction' => '36', 'reduction' => '0', 'specific_prices' => array(), 'quantity' => '15', 'quantity_all_versions' => '15', 'id_image' => 'fr-default', 'features' => array(), 'attachments' => array(), 'virtual' => '0', 'pack' => '0', 'packItems' => array(), 'nopackprice' => '0', 'customization_required' => false, 'rate' => '20', 'tax_name' => 'TVA FR 20%', 'ecotax_rate' => '0', 'unit_price' => '0', 'customizations' => array('fields' => array()), 'id_customization' => '0', 'is_customizable' => false, 'show_quantities' => true, 'quantity_label' => 'Produits', 'quantity_discounts' => array(), 'customer_group_discount' => '0'), object(Language)) in ProductController.php line 1000 at ProductControllerCore->getTemplateVarProduct() in ProductController.php line 329 at ProductControllerCore->initContent() in Controller.php line 205 at ControllerCore->run() in Dispatcher.php line 379 at DispatcherCore->dispatch() in index.php line 28 Pourtant, quand je vais dans le FTP, dans le répertoire img/p/2/7 j'ai bien l'image qui se nomme 27.jpg Savez vous comment me sortir de cette impasse ? Je suis nouvel utilisateur de Prestashop et là je suis bloqué malgré les recherches que j'ai pu faire. Link to comment Share on other sites More sharing options...
BeComWeb Posted October 25, 2017 Share Posted October 25, 2017 Bonjour, Avez-vous essayé de régénérer les images (menu "Apparence > Images", tout en bas) ? Quelle version de PHP vous utilisez ? Link to comment Share on other sites More sharing options...
Alex Posted October 25, 2017 Author Share Posted October 25, 2017 Bonjour, merci pour votre réponse :-) J'utilise la version 5.5.57-0 de PHP J'ai régénéré plusieurs fois les images mais sans succès, cela ne change rien au problème d'affichage Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now