html2 3 Posted August 25, 2017 Posted August 25, 2017 (edited) Bonjour, Depuis quelques temps mes clients n'ont plus accès à leurs points de fidelité. Voici l'erreur que j'ai il affiche une partie de la page et : Fatal error: Unsupported operand types in /var/www/jdt16112/cache/smarty/compile/f1/29/8c/f1298c1de3dfe1dba34efceb03b04e6446f397f0.file.loyalty.tpl.php on line 251 Ce qui est bizarre c'est que si un compte ne comporte pas de points la page s'affiche normalement. J'ai installé, désinstaller le module et toujours la même erreur. J'ai ensuite uploader la base sql du module et l'ai remis sur mon local et tout ce passe bien. Auriez vous une idée..? Voici ce qu'affiche le fichier smarty <?php if ($_smarty_tpl->tpl_vars['nbpagination']->value*$_smarty_tpl->tpl_vars['page']->value<count($_smarty_tpl->tpl_vars['orders']->value)) {?> <?php $_smarty_tpl->tpl_vars['itemShowing'] = new Smarty_variable($_smarty_tpl->tpl_vars['nbpagination']->value*$_smarty_tpl->tpl_vars['page']->value, null, 0);?> <?php } else { ?> Ligne 256 !! <?php $_smarty_tpl->tpl_vars['itemShowing'] = new Smarty_variable(($_smarty_tpl->tpl_vars['nbpagination']->value*$_smarty_tpl->tpl_vars['page']->value-count($_smart$ <?php }?> <?php if ($_smarty_tpl->tpl_vars['page']->value==1) {?> <?php $_smarty_tpl->tpl_vars['itemShowingStart'] = new Smarty_variable(1, null, 0);?> <?php } else { ?> <?php $_smarty_tpl->tpl_vars['itemShowingStart'] = new Smarty_variable($_smarty_tpl->tpl_vars['nbpagination']->value*$_smarty_tpl->tpl_vars['page']->value-$_smarty_$ <?php }?> <?php if (count($_smarty_tpl->tpl_vars['orders']->value)>1) {?> <?php echo smartyTranslate(array('s'=>'Showing %1$d - %2$d of %3$d items','sprintf'=>array($_smarty_tpl->tpl_vars['itemShowingStart']->value,$_smarty_tpl->tpl_vars[$ <?php } else { ?> <?php echo smartyTranslate(array('s'=>'Showing %1$d - %2$d of 1 item','sprintf'=>array($_smarty_tpl->tpl_vars['itemShowingStart']->value,$_smarty_tpl->tpl_vars['ite$ <?php }?> Merci de votre aide PS: info du serveur INFORMATIONS SUR VOTRE SERVEURInformations sur votre serveur Linux #88-Ubuntu SMP Tue Dec 3 17:37:58 UTC 2013 x86_64 Version du logiciel serveur Apache Version de PHP 5.4.45-4+deprecated+dontuse+deb.sury.org~precise+1 Limite de mémoire 1024M Temps d'exécution maximal (max_execution_time) 0 Module PageSpeed pour Apache installé (mod_instaweb) Edited August 25, 2017 by html2 (see edit history) Share this post Link to post Share on other sites
doekia 1,503 Posted August 26, 2017 Posted August 26, 2017 et.... la ligne 251 ? Share this post Link to post Share on other sites
html2 3 Posted August 27, 2017 Posted August 27, 2017 Bonjour ! Alors oui désolé ... <!-- <div class="product-count"> 251 !! <?php if ($_smarty_tpl->tpl_vars['nbpagination']->value*$_smarty_tpl->tpl_vars['page']->value<count($_smarty_tpl->tpl_vars['orders']->value)) {?> <?php $_smarty_tpl->tpl_vars['itemShowing'] = new Smarty_variable($_smarty_tpl->tpl_vars['nbpagination']->value*$_smarty_tpl->tpl_vars['page']->value, null, 0);?> <?php } else { ?> // <?php $_smarty_tpl->tpl_vars['itemShowing'] = new Smarty_variable(($_smarty_tpl->tpl_vars['nbpagination']->value*$_smarty_tpl->tpl_vars['page']->value-count($_smart$ <?php }?> <?php if ($_smarty_tpl->tpl_vars['page']->value==1) {?> <?php $_smarty_tpl->tpl_vars['itemShowingStart'] = new Smarty_variable(1, null, 0);?> <?php } else { ?> <?php $_smarty_tpl->tpl_vars['itemShowingStart'] = new Smarty_variable($_smarty_tpl->tpl_vars['nbpagination']->value*$_smarty_tpl->tpl_vars['page']->value-$_smarty_$ <?php }?> <?php if (count($_smarty_tpl->tpl_vars['orders']->value)>1) {?> <?php echo smartyTranslate(array('s'=>'Showing %1$d - %2$d of %3$d items','sprintf'=>array($_smarty_tpl->tpl_vars['itemShowingStart']->value,$_smarty_tpl->tpl_vars[$ <?php } else { ?> <?php echo smartyTranslate(array('s'=>'Showing %1$d - %2$d of 1 item','sprintf'=>array($_smarty_tpl->tpl_vars['itemShowingStart']->value,$_smarty_tpl->tpl_vars['ite$ <?php }?> </div> --> <div> Une idée alors..? Share this post Link to post Share on other sites
html2 3 Posted August 29, 2017 Posted August 29, 2017 Personne ne peut m'aider ..? Cdlt Share this post Link to post Share on other sites
doekia 1,503 Posted August 29, 2017 Posted August 29, 2017 La 1ere ligne de ce fichier te donnera le chemin exact du source de cette compilation. Tu devrais y trouver une section +/- ligne 152 <div class="product-count"> {if ($nbpagination*$page) < $orders|@count } {assign var='itemShowing' value=$nbpagination*$page} {else} {assign var='itemShowing' value=($nbpagination*$page-$orders|@count-$nbpagination*$page)*-1} {/if} {if $page==1} {assign var='itemShowingStart' value=1} {else} {assign var='itemShowingStart' value=$nbpagination*$page-$nbpagination+1} {/if} {if $orders|@count > 1} {l s='Showing %1$d - %2$d of %3$d items' sprintf=[$itemShowingStart, $itemShowing, $orders|@count] mod='loyalty'} {else} {l s='Showing %1$d - %2$d of 1 item' sprintf=[$itemShowingStart, $itemShowing] mod='loyalty'} {/if} </div> Si ton code est celui-ci, l'erreur provient en amont d'un bug dans ta version du module ou d'un contrôleur qui ne fait pas son job (impossible de t'en dire plus à distance) Si ton code est différent, corrige le 1 Share this post Link to post Share on other sites
html2 3 Posted August 31, 2017 Posted August 31, 2017 Salut ! Bon j 'ai le même code et sa fonctionne toujours pas ... Tu m'as parlé du controller donc du coup j'ai commenté ce bout de code dans : /modules/loyalty/controllers/front/default.php /** * Assign summary template */ public function assignSummaryExecution() {/* $customer_points = (int)LoyaltyModule::getPointsByCustomer((int)$this->context->customer->id); $orders = LoyaltyModule::getAllByIdCustomer((int)$this->context->customer->id, (int)$this->context->language->id); $displayorders = LoyaltyModule::getAllByIdCustomer( (int)$this->context->customer->id, (int)$this->context->language->id, false, true, ((int)Tools::getValue('n') > 0 ? (int)Tools::getValue('n') : 10), ((int)Tools::getValue('p') > 0 ? (int)Tools::getValue('p') : 1) ); $this->context->smarty->assign(array( 'orders' => $orders, 'displayorders' => $displayorders, 'totalPoints' => (int)$customer_points, 'voucher' => LoyaltyModule::getVoucherValue($customer_points, (int)$this->context->currency->id), 'validation_id' => LoyaltyStateModule::getValidationId(), 'transformation_allowed' => $customer_points > 0, 'page' => ((int)Tools::getValue('p') > 0 ? (int)Tools::getValue('p') : 1), 'nbpagination' => ((int)Tools::getValue('n') > 0 ? (int)Tools::getValue('n') : 10), 'nArray' => array(10, 20, 50), 'max_page' => floor(count($orders) / ((int)Tools::getValue('n') > 0 ? (int)Tools::getValue('n') : 10)), 'pagination_link' => Context::getContext()->link->getModuleLink('loyalty','default') )); Et miracle ma page reviens... Sauf que normale il affiche pas les points de fidélités. Le module peut être en conflit avec notre module .? Cordialement, Thomas Share this post Link to post Share on other sites
html2 3 Posted August 31, 2017 Posted August 31, 2017 Je reviens vers vous..; l'erreur provient de la ... $this->context->smarty->assign(array( // 'orders' => $orders, 'displayorders' => $displayorders, 'totalPoints' => (int)$customer_points, 'voucher' => LoyaltyModule::getVoucherValue($customer_points, (int)$this->context->currency->id), 'validation_id' => LoyaltyStateModule::getValidationId(), 'transformation_allowed' => $customer_points > 0, 'page' => ((int)Tools::getValue('p') > 0 ? (int)Tools::getValue('p') : 1), 'nbpagination' => ((int)Tools::getValue('n') > 0 ? (int)Tools::getValue('n') : 10), 'nArray' => array(10, 20, 50), 'max_page' => floor(count($orders) / ((int)Tools::getValue('n') > 0 ? (int)Tools::getValue('n') : 10)), 'pagination_link' => Context::getContext()->link->getModuleLink('loyalty','default') )); // 'orders' => $orders, Truc improbable... j’espère que vous avez des idées.... Share this post Link to post Share on other sites
doekia 1,503 Posted August 31, 2017 Posted August 31, 2017 ben si tu enlèves la variable qui est testé, normal que ça déconne. Décommente cette ligne Share this post Link to post Share on other sites
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