@rthur Posted June 28, 2019 Share Posted June 28, 2019 (edited) Salut, J'ai un souci sur ma boutique (v1.7.5). Lorsque je passe en mode debug j'ai tout en tas d'erreur qui apparaissent sauf que je ne comprends pas du tout ce que cela signifie... Ca vous parle ?? Merci bcp ! Edited November 4, 2020 by @rthur (see edit history) Link to comment Share on other sites More sharing options...
Eolia Posted June 29, 2019 Share Posted June 29, 2019 tpl module mal écrit qui appelle des variables indéfinies / inexistantes Link to comment Share on other sites More sharing options...
@rthur Posted July 1, 2019 Author Share Posted July 1, 2019 Merci. Une idée comment régler le problème? Il semble que c'est une seule et même variable qui pose problème. Link to comment Share on other sites More sharing options...
Eolia Posted July 1, 2019 Share Posted July 1, 2019 un {if isset($custom_id)} à la ligne 55 de psmainmenupsmainmenu.tpl.php suivi d'un {/if} autour de la variable appelée devrait régler le problème Link to comment Share on other sites More sharing options...
@rthur Posted July 1, 2019 Author Share Posted July 1, 2019 Merci. Deux choses, le fichier se trouve dans un répertoire bizarre : var/cache/prod/smarty/compile/41/df/19/... Est-ce normal de modifier un fichier dans ce répertoire? Ensuite voici l'extrait de code qui commence ligne 55 : if ($_smarty_tpl->tpl_vars['custom_id']->value[1] == 'category') { $_smarty_tpl->_assignInScope('custom_id', explode("-",$_smarty_tpl->tpl_vars['node']->value['page_identifier'])); $_smarty_tpl->_assignInScope('category_name', Category::getLinkRewrite($_smarty_tpl->tpl_vars['custom_id']->value[1],$_smarty_tpl->tpl_vars['language']->value['id'])); Comment modifier ? je ne veut pas faire de bêtises en touchant le code... Merci bcp ! Link to comment Share on other sites More sharing options...
Eolia Posted July 1, 2019 Share Posted July 1, 2019 ca c'est le compilé, allez chercher et corriger le source dans le module psmainmenu (ou dans themes/votre_theme/modules/psmainmenu) Link to comment Share on other sites More sharing options...
@rthur Posted July 1, 2019 Author Share Posted July 1, 2019 J'aimerais bien mais ce fichier est nul part... J'ai regardé dans monsite/modules/psmainmenu et voici en PJ l’arborescence du dossier. J'ai aussi regardé dans monsite/themes/classic/modules/psmainmenu et dans monsite/themes/montheme/modules/psmainmenu, rien non plus dedans, juste 2 fichiers qui ne correspondent pas (cf PJ)... Link to comment Share on other sites More sharing options...
Eolia Posted July 1, 2019 Share Posted July 1, 2019 c'est ps_mainmenu.tpl, le debug a tout collé^^ Link to comment Share on other sites More sharing options...
@rthur Posted July 1, 2019 Author Share Posted July 1, 2019 3 minutes ago, Eolia said: c'est ps_mainmenu.tpl, le debug a tout collé^^ Merci ! Ok je comprends mieux ... Voici le contenu du fichier en question. Tu pourrais m'aider sur quoi modifier et de quelle manière parce que du coup ça ne correspond pas à la ligne indiquée dans le debug... ? {strip} {assign var=_counter value=0} {function name="menu" nodes=[] depth=0 parent=null} {if $nodes|count} <ul class="jhp-header-menu" {if $depth == 0}id="jhp-top-menu"{/if} data-depth="{$depth}"> {if $depth == 0} <li class="{if $page.page_name=='index'}current {/if} jhpmain-menu-wrapper "> </li> {/if} {foreach from=$nodes item=node} <li class="{$node.type}{if $node.current} current {/if} jhpmain-menu-wrapper {if $node.children|count}jhp-has-child{/if}" id="{$node.page_identifier}" {if $node.children|count}{assign var=_expand_id value=10|mt_rand:100000}child-dropdown='top_sub_menu_{$_expand_id}'{/if}> {assign var=_counter value=$_counter+1} <div class="jhpmenu-link-wrapper"> <a class="{if $depth === 1} jhpdropdown-submenu sousmenu{/if} jhpmenu-link" href="{$node.url}" data-depth="{$depth}" {if $node.open_in_new_window} target="_blank" {/if}> <span class="jhpmain-menu-text-box"> {$node.label} </span> {if $depth > 0} {if $custom_id[1] == 'category'} {assign var=custom_id value="-"|explode:$node.page_identifier} {$category_name = Category::getLinkRewrite($custom_id[1], $language.id)} {$files_check = $link->getCatImageLink($category_name, $custom_id[1], 'small_default')} <img src="{$files_check}" alt='{$node.label}'> {/if} {/if} </a> {if $node.children|count} <span class="jhpmenu-toggle-icon"> <i class='material-icons jhphorizontal-menu-drop-down-icon'></i> </span> {/if} </div> {if $node.children|count} <div {if $depth === 0 } class="jhpmain-menu-dropdown jhpmain-menu-sub-menu jhpmain-menu-mobile-dropdown " {elseif $depth === 1 } class="jhpmain-menu-mobile-dropdown" {else} class="" {/if} > {menu nodes=$node.children depth=$node.depth parent=$node} {if $depth === 0 && $node.children.0.children} {if $node.image_urls} {foreach $node.image_urls as $image} <div class="jhpheader-top-menu-img"> <img src="{$image}" alt="{$node.label}"> </div> {/foreach} {/if} {/if} </div> {/if} </li> {/foreach} </ul> {/if} {/function} <div id='jhpcmsdesktop-main-menu'> <div class='jhpcmsmain-menu-wrapper' {* id="_desktop_top_menu" *}> {menu nodes=$menu.children} <div class="clearfix"></div> <div class="jhpmenu-button-wrapper"> <div class="jhpmenu-button"> <a href="#"> <span class="Jhpmenu-top"></span> <span class="Jhpmenu-middle"></span> <span class="Jhpmenu-bottom"></span> </a> </div> </div> </div> </div> {/strip} Link to comment Share on other sites More sharing options...
Eolia Posted July 1, 2019 Share Posted July 1, 2019 Bah il suffit de chercher la variable concernée... Il y a 2 heures, @rthur a dit : {if $custom_id[1] == 'category'} Link to comment Share on other sites More sharing options...
@rthur Posted July 1, 2019 Author Share Posted July 1, 2019 J'aurais juste aimé savoir par quoi le remplacer exactement, j'aimerais éviter de plomber mon site avec une erreur dans le code, je ne suis pas codeur... Merci de votre aide Link to comment Share on other sites More sharing options...
Eolia Posted July 1, 2019 Share Posted July 1, 2019 {if !empty($custom_id[1]) && ($custom_id[1] == 'category')} Link to comment Share on other sites More sharing options...
@rthur Posted July 1, 2019 Author Share Posted July 1, 2019 51 minutes ago, Eolia said: {if !empty($custom_id[1]) && ($custom_id[1] == 'category')} Ca marche parfaitement merci mille fois ! Link to comment Share on other sites More sharing options...
Eolia Posted July 2, 2019 Share Posted July 2, 2019 Je me doute 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