Bonjour à tous !
Je suis débutante sur Prestashop🤓 et je ne trouve nulle part de solution à mon bug.
Type d’install (nouvelle/MàJ) : Downgrade de PS 1.7.7.4 à PS 1.7.6.9
Version de PS : 1.7.6.9
URL du site concerné : LOCAL
Thème (défaut/perso) : Child-classic (récupéré de la version 1.7.7.4)
Code (original/modifié) : ajout de CSS et de Javascript
Hébergement : LOCAL
Version de PHP :7.2.33
Version de MySQL : 5.7.31
Navigateur(s) concerné(s) : CHROME, Edge
Je travaille avec la version 1.7.6.9 de Prestashop pour des raisons de compatibilité avec le module de paiement souhaité.
Lorsque je me rends sur la boutique en mode PROD, j'ai ma page produit qui s'affiche ainsi que la miniature en bas à gauche de l'image de couverture, mais pas d'image de couverture.
Lorsque je me rend sur la boutique en mode DEV (config/defines.inc.php -> _PS_MODE_DEV, 'true'), j'ai un message d'erreur :
Quote
(1/1) ContextErrorException
Notice: Undefined index: id_image
in ****************************_2.file.product-cover-thumbnails.tpl.php line 92
at Block_201090691960cb1790bdeee3_67393852->callBlock(object(SmartyDevTemplate))in smarty_internal_runtime_inheritance.php line 248
at Smarty_Internal_Runtime_Inheritance->callBlock(object(Block_201090691960cb1790bdeee3_67393852), object(SmartyDevTemplate))in smarty_internal_runtime_inheritance.php line 184
at Smarty_Internal_Runtime_Inheritance->process(object(SmartyDevTemplate), object(Block_201090691960cb1790bdeee3_67393852))in smarty_internal_runtime_inheritance.php line 156
at Smarty_Internal_Runtime_Inheritance->instanceBlock(object(SmartyDevTemplate), 'Block_201090691960cb1790bdeee3_67393852', 'product_images')in ***************************.file.product-cover-thumbnails.tpl.php line 34
at content_60cb1790bfef16_01917843(object(SmartyDevTemplate))in smarty_template_resource_base.php line 123
at Smarty_Template_Resource_Base->getRenderedTemplateCode(object(SmartyDevTemplate))in smarty_template_compiled.php line 114
at Smarty_Template_Compiled->render(object(SmartyDevTemplate))in smarty_internal_template.php line 216
at Smarty_Internal_Template->render()in smarty_internal_template.php line 385
at Smarty_Internal_Template->_subTemplateRender('file:catalog/_partials/product-cover-thumbnails.tpl', null, 'layouts/layout-full-width.tpl', 0, 3600, array(), 0, false)in 0277da3b23d246f3037e6ab2eea05faa6aed4192_2.file.product.tpl.php line 125
at Block_23049582860cb17906bec07_33497529->callBlock(object(SmartyDevTemplate))in smarty_internal_runtime_inheritance.php line 248
at Smarty_Internal_Runtime_Inheritance->callBlock(object(Block_23049582860cb17906bec07_33497529), object(SmartyDevTemplate))in smarty_internal_runtime_inheritance.php line 184
at Smarty_Internal_Runtime_Inheritance->process(object(SmartyDevTemplate), object(Block_23049582860cb17906bec07_33497529))in smarty_internal_runtime_inheritance.php line 156
at Smarty_Internal_Runtime_Inheritance->instanceBlock(object(SmartyDevTemplate), 'Block_23049582860cb17906bec07_33497529', 'product_cover_thumbnails', 0)in 0277da3b23d246f3037e6ab2eea05faa6aed4192_2.file.product.tpl.php line 141
at Block_10707747060cb17906ba9f9_12027423->callBlock(object(SmartyDevTemplate))in smarty_internal_runtime_inheritance.php line 248
at Smarty_Internal_Runtime_Inheritance->callBlock(object(Block_10707747060cb17906ba9f9_12027423), object(SmartyDevTemplate))in smarty_internal_runtime_inheritance.php line 184
at Smarty_Internal_Runtime_Inheritance->process(object(SmartyDevTemplate), object(Block_10707747060cb17906ba9f9_12027423))in smarty_internal_runtime_inheritance.php line 156
at Smarty_Internal_Runtime_Inheritance->instanceBlock(object(SmartyDevTemplate), 'Block_10707747060cb17906ba9f9_12027423', 'page_content', 0)in 0277da3b23d246f3037e6ab2eea05faa6aed4192_2.file.product.tpl.php line 161
at Block_74499198060cb17906b9579_27444490->callBlock(object(SmartyDevTemplate))in smarty_internal_runtime_inheritance.php line 248
at Smarty_Internal_Runtime_Inheritance->callBlock(object(Block_74499198060cb17906b9579_27444490), object(SmartyDevTemplate))in smarty_internal_runtime_inheritance.php line 184
at Smarty_Internal_Runtime_Inheritance->process(object(SmartyDevTemplate), object(Block_74499198060cb17906b9579_27444490))in smarty_internal_runtime_inheritance.php line 156
at Smarty_Internal_Runtime_Inheritance->instanceBlock(object(SmartyDevTemplate), 'Block_74499198060cb17906b9579_27444490', 'page_content_container', 0)in 0277da3b23d246f3037e6ab2eea05faa6aed4192_2.file.product.tpl.php line 797
at Block_160038793960cb17906b6399_43141867->callBlock(object(SmartyDevTemplate))in smarty_internal_runtime_inheritance.php line 248
at Smarty_Internal_Runtime_Inheritance->callBlock(object(Block_160038793960cb17906b6399_43141867), object(SmartyDevTemplate))in smarty_internal_runtime_inheritance.php line 184
at Smarty_Internal_Runtime_Inheritance->process(object(SmartyDevTemplate), object(Block_160038793960cb17906b6399_43141867), object(Block_72003509160cb17907d9210_37825438))in smarty_internal_runtime_inheritance.php line 186
at Smarty_Internal_Runtime_Inheritance->process(object(SmartyDevTemplate), object(Block_72003509160cb17907d9210_37825438))in smarty_internal_runtime_inheritance.php line 156
at Smarty_Internal_Runtime_Inheritance->instanceBlock(object(SmartyDevTemplate), 'Block_72003509160cb17907d9210_37825438', 'content', 1)in 445f91407400ec1c90224a96b7d97d733f45a8fa_2.file.layout-full-width.tpl.php line 101
at Block_255877860cb17907d4410_00829769->callBlock(object(SmartyDevTemplate))in smarty_internal_runtime_inheritance.php line 248
at Smarty_Internal_Runtime_Inheritance->callBlock(object(Block_255877860cb17907d4410_00829769), object(SmartyDevTemplate))in smarty_internal_runtime_inheritance.php line 184
at Smarty_Internal_Runtime_Inheritance->process(object(SmartyDevTemplate), object(Block_255877860cb17907d4410_00829769), object(Block_11947613560cb17908344e9_35090822))in smarty_internal_runtime_inheritance.php line 186
at Smarty_Internal_Runtime_Inheritance->process(object(SmartyDevTemplate), object(Block_11947613560cb17908344e9_35090822))in smarty_internal_runtime_inheritance.php line 156
at Smarty_Internal_Runtime_Inheritance->instanceBlock(object(SmartyDevTemplate), 'Block_11947613560cb17908344e9_35090822', 'content_wrapper')in 3dc23408a91d79465f8f404346594be89a130d67_2.file.layout-both-columns.tpl.php line 87
at content_60cb17908567b3_32733970(object(SmartyDevTemplate))in smarty_template_resource_base.php line 123
at Smarty_Template_Resource_Base->getRenderedTemplateCode(object(SmartyDevTemplate))in smarty_template_compiled.php line 114
at Smarty_Template_Compiled->render(object(SmartyDevTemplate))in smarty_internal_template.php line 216
at Smarty_Internal_Template->render()in smarty_internal_template.php line 385
at Smarty_Internal_Template->_subTemplateRender('layouts/layout-both-columns.tpl', null, 'layouts/layout-full-width.tpl', 0, 3600, array(), 2, false, null, null)in smarty_internal_runtime_inheritance.php line 125
at Smarty_Internal_Runtime_Inheritance->endChild(object(SmartyDevTemplate), 'layouts/layout-both-columns.tpl')in 445f91407400ec1c90224a96b7d97d733f45a8fa_2.file.layout-full-width.tpl.php line 42
at content_60cb17907e0038_97136493(object(SmartyDevTemplate))in smarty_template_resource_base.php line 123
at Smarty_Template_Resource_Base->getRenderedTemplateCode(object(SmartyDevTemplate))in smarty_template_compiled.php line 114
at Smarty_Template_Compiled->render(object(SmartyDevTemplate))in smarty_internal_template.php line 216
at Smarty_Internal_Template->render()in smarty_internal_template.php line 385
at Smarty_Internal_Template->_subTemplateRender('layouts/layout-full-width.tpl', null, 'layouts/layout-full-width.tpl', 0, 3600, array(), 2, false, null, null)in smarty_internal_runtime_inheritance.php line 125
at Smarty_Internal_Runtime_Inheritance->endChild(object(SmartyDevTemplate), 'layouts/layout-full-width.tpl')in ***********************.file.product.tpl.php line 55
at content_60cb17907a5a36_93700803(object(SmartyDevTemplate))in smarty_template_resource_base.php line 123
at Smarty_Template_Resource_Base->getRenderedTemplateCode(object(SmartyDevTemplate))in smarty_template_compiled.php line 114
at Smarty_Template_Compiled->render(object(SmartyDevTemplate))in smarty_internal_template.php line 216
at Smarty_Internal_Template->render(false, 0)in smarty_internal_templatebase.php line 232
at Smarty_Internal_TemplateBase->_execute(object(SmartyDevTemplate), null, 'layouts/layout-full-width.tpl', null, 0)in smarty_internal_templatebase.php line 116
at Smarty_Internal_TemplateBase->fetch('catalog/product.tpl', null, 'layouts/layout-full-width.tpl', null, false, true, false)in SmartyDev.php line 40
at SmartyDev->fetch('catalog/product.tpl', null, 'layouts/layout-full-width.tpl')in FrontController.php line 683
at FrontControllerCore->smartyOutputContent('catalog/product.tpl')in FrontController.php line 667
at FrontControllerCore->display()in Controller.php line 312
at ControllerCore->run()in Dispatcher.php line 515
at DispatcherCore->dispatch()in index.php line 28
Voici un extrait du fichier concerné :
Quote
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['image']->value) {
?>
<li class="thumb-container">
<img
class="thumb js-thumb <?php if ($_smarty_tpl->tpl_vars['image']->value['id_image'] == $_smarty_tpl->tpl_vars['product']->value['default_image']['id_image']) {?> selected <?php }?>"
data-image-medium-src="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['image']->value['bySize']['medium_default']['url'], ENT_QUOTES, 'UTF-8');?>
"
data-image-large-src="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['image']->value['bySize']['large_default']['url'], ENT_QUOTES, 'UTF-8');?>
"
src="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['image']->value['bySize']['home_default']['url'], ENT_QUOTES, 'UTF-8');?>
"
alt="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['image']->value['legend'], ENT_QUOTES, 'UTF-8');?>
"
title="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['image']->value['legend'], ENT_QUOTES, 'UTF-8');?>
"
width="100"
itemprop="image"
>
</li>
<?php
}
}
La ligne 92 est en gras.
J'ai déjà essayé plusieurs choses : Régénérer les miniatures, supprimer et réimporter les images, vider le cache Prestashop, vider le cache Chrome...
Ah, oui, une précision : je travaille avec un thème child-classic importé d'une précédente version du projet réalisée sous Prestashop 1.7.7.4 mais je n'ai pas trouvé de différences dans les fichiers de templates "produits" comme product-cover-thumbnails.tpl, donc je ne suis pas sûre que ce soit important.
Si quelqu'un a une idée, ça m'aiderait beaucoup.
Bonne journée !