• RE: Erreur 500 suite installation

    Bah ce n'est pas possible, dans tous les cas on envoie un tableau donc le tpl ne peut pas dire que ce n'est pas un tableau.
    Vous avez vidé le cache Prestashop ?

    posté dans Questions relatives à l'installation/upgrade
  • RE: Erreur 500 suite installation

    Ok.
    Ce n'est pas normal que ce ne soit pas un tableau.
    Pour votre cas voici le correctif à effectuer:
    Dans le fichier /classes/AdminController.php, vers la ligne 2211 vous avez la fonction initHeader
    Dans celle-ci, remplacez le block concernant // Quick access par celui-ci:

            // Quick access
            if((int)$this->context->employee->id) {
                $quick_access = QuickAccess::getQuickAccesses($this->context->language->id);
                if(is_array($quick_access)) {
                    foreach($quick_access as $index => $quick) {
                        if($quick['link'] == '../' && Shop::getContext() == Shop::CONTEXT_SHOP) {
                            $url = $this->context->shop->getBaseURL();
                            if(!$url) {
                                unset($quick_access[$index]);
                                continue;
                            }
                            $quick_access[$index]['link'] = $url;
                        }
                        else {
                            preg_match('/controller=(.+)(&.+)?$/', $quick['link'], $admin_tab);
                            if(isset($admin_tab[1])) {
                                if(strpos($admin_tab[1], '&')) {
                                    $admin_tab[1] = substr($admin_tab[1], 0, strpos($admin_tab[1], '&'));
                                }
    
                                $token = Tools::getAdminToken($admin_tab[1]
                                    .(int)Tab::getIdFromClassName($admin_tab[1])
                                    .(int)$this->context->employee->id);
                                $quick_access[$index]['target'] = $admin_tab[1];
                                $quick_access[$index]['link'] .= '&token='.$token;
                            }
                        }
                    }
                }
                else {
                    $quick_access = array();
                }
            }
    
    posté dans Questions relatives à l'installation/upgrade
  • RE: Erreur 500 suite installation

    @eolia a dit dans Erreur 500 suite installation :

    /cache/smarty/compile/fb/5d/7e/fb5d7e0bc3cda93822e06fc1bb7acfb4c0d58e12_0.file.header.tpl.php:

    Il y a quoi dans ce fichier à la ligne 405 ?

    Pouvez-vous me répondre svp ?

    posté dans Questions relatives à l'installation/upgrade
  • RE: Erreur 500 suite installation

    @krys a dit dans Erreur 500 suite installation :

    /cache/smarty/compile/fb/5d/7e/fb5d7e0bc3cda93822e06fc1bb7acfb4c0d58e12_0.file.header.tpl.php:

    Il y a quoi dans ce fichier à la ligne 405 ?

    Il faudrait savoir ce que fait votre override de Hook.php aussi.
    Vos erreur sont là car vous êtes passé sur une version PHP supérieure à 7. Si vos overrides n'ont pas été écrites pour cette version ça ne peut pas fonctionner.

    posté dans Questions relatives à l'installation/upgrade
  • RE: Erreur 500 suite installation

    Bonjour @krys,
    Avez-vous accès au fichier error.log de votre serveur ?
    Sinon vous pouvez activer le mode debug en mettant la valeur à 1 dans le fichier /config/debug.php:

    define('_PS_MODE_DEV_', 1);
    
    posté dans Questions relatives à l'installation/upgrade
  • RE: Suite mise à jour vers 1.6.2.15

    Oui, mais cette partie n'est pas gérée lors de l'install/upgrade du CMS.
    Je viens d'ajouter un contrôle dans le constructeur de Module.php et si la dépendance n'est pas installée, le module sera lui-même désinstallé.

    posté dans Bugs & Améliorations
  • RE: Suite mise à jour vers 1.6.2.15

    Avec le nouveau code la dépendance sera réelle.
    Il faut que je regarde comment ils ont codé le dependencies...

    posté dans Bugs & Améliorations
  • RE: Suite mise à jour vers 1.6.2.15

    Bonjour,
    Quelle version du module productcomments ?
    La fonction appellée:

        public static function getByValidate($validate = 0, $deleted = false)
        {
            return Db::getInstance()->executeS('
                SELECT pc.`id_product_comment`, pc.`id_product`, 
                    IF(c.id_customer, CONCAT(c.`firstname`, \' \',  c.`lastname`), pc.customer_name) customer_name, 
                    pc.`title`, pc.`content`, pc.`grade`, pc.`date_add`, pl.`name`
                FROM `'._DB_PREFIX_.'product_comment` pc
                LEFT JOIN `'._DB_PREFIX_.'customer` c 
                    ON(c.`id_customer` = pc.`id_customer`)
                LEFT JOIN `'._DB_PREFIX_.'product_lang` pl 
                    ON(pl.`id_product` = pc.`id_product` 
                    AND pl.`id_lang` = '.(int)Context::getContext()->language->id.Shop::addSqlRestrictionOnLang('pl').')
                WHERE pc.`validate` = '.(int)$validate.'
                ORDER BY pc.`date_add` DESC
            ');
        }
    

    Dans tous les cas ça renvoie un tableau (vide ou pas) sauf si le module n'est pas installé et que les tables n'existent pas.

    Je vais donc mettre à jour le module en modifiant le code ainsi:

    <?php
            
            /**
            
             * 2022-2023 PhenixSuite®
            
             *
            
             * NOTICE OF LICENSE
            
             *
            
             * This source file is subject to the Open Software License (OSL 3.0)
            
             * that is bundled with this package in the file LICENSE.txt.
            
             * It is also available through the world-wide-web at this URL:
            
             * http://opensource.org/licenses/osl-3.0.php
            
             * If you did not receive a copy of the license and are unable to
            
             * obtain it through the world-wide-web, please send an email
            
             * to license@phenixsuite.com so we can send you a copy immediately.
            
             *
            
             * DISCLAIMER
            
             *
            
             * Do not edit or add to this file if you wish to upgrade PhenixSuite to newer
            
             * versions in the future. If you wish to customize PhenixSuite for your
            
             * needs please refer to https://phenixsuite.com for more information.
            
             *
            
             *  @author    PhenixSuite <contact@phenixsuite.com>
            
             *  @copyright 2022-2023 PhenixSuite®
            
             *  @license   https://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
            
             */
            
             
            
            if(!defined('_PS_VERSION_')) {
            
                exit;
            
            }
            
            
            
            class CommentsAlert extends Module
            
            {
            
                private $waiting_approval = 0;
            
                private $reported = 0;
            
                private $associated = false;
            
                
            
                public function __construct()
            
                {
            
                    $this->name = 'commentsalert';
            
                    $this->tab = 'administration';
            
                    $this->version = '1.3';
            
                    $this->author = 'Eolia';
            
                    $this->need_instance = 0;
            
                    $this->ps_versions_compliancy = array('min' => '1.6', 'max' => '1.6.99.99');
            
                    $this->dependencies = array('productcomments');
            
            
            
                    parent::__construct();
            
            
            
                    $this->displayName = $this->l('Comments Alert');
            
                    $this->description = $this->l('Backoffice visual and sound alert for unapproved and reported comments.');
            
                    $this->confirmUninstall = $this->l('Are you sure you want to uninstall?');
            
            
            
                    if(Module::isInstalled('productcomments')) {
            
                        if(file_exists(_PS_ROOT_DIR_.'/modules/productcomments/ProductComment.php')) {
            
                            require_once(_PS_ROOT_DIR_.'/modules/productcomments/ProductComment.php');
            
                        }
            
                        $this->associated = true;
            
                        $this->waiting_approval = count(ProductComment::getByValidate(0, false));
            
                        $this->reported = count(ProductComment::getReportedComments());
            
                    }
            
                }
            
            
            
                public function install()
            
                {
            
                    if(parent::install() == false
            
                        || !$this->registerHook('actionAdminControllerSetMedia')
            
                        || !$this->registerHook('displayBackOfficeTop')
            
                    ) {
            
                        return false;
            
                    }
            
                    Configuration::updateValue('COMMENTS_ALERT_LAST_AWAITING', 0);
            
                    Configuration::updateValue('COMMENTS_ALERT_LAST_REPORT', 0);
            
            
            
                    return true;
            
                }
            
            
            
                public function uninstall()
            
                {
            
                    if(!parent::uninstall() 
            
                        || !$this->unregisterHook('actionAdminControllerSetMedia') 
            
                        || !$this->unregisterHook('displayBackOfficeTop')
            
                    ) {
            
                        return false;
            
                    }
            
                    Configuration::deleteByName('COMMENTS_ALERT_LAST_AWAITING');
            
                    Configuration::deleteByName('COMMENTS_ALERT_LAST_REPORT');
            
            
            
                    return true;
            
                }
            
            
            
                public function hookActionAdminControllerSetMedia()
            
                {
            
                    if(!$this->associated) {
            
                        return;
            
                    }
            
                    $this->context->controller->addJs($this->_path.'views/js/commentsalert.js');
            
                    $this->context->controller->addCss($this->_path.'views/css/commentsalert.css');
            
                }
            
            
            
                public function hookDisplayBackOfficeTop($params)
            
                {
            
                    if(!$this->associated) {
            
                        return;
            
                    }
            
                    if(Tools::getValue('action') == 'updateCommentsInfo' 
            
                        && Tools::getValue('ajax') == 1
            
                    ) {
            
                        $this->ajaxUpdateCommentsInfo();
            
                    }
            
                    else {
            
                        $this->context->smarty->assign(array(
            
                            'link' => $this->context->link,
            
                            'waiting_approval' => min(
            
                                Configuration::get('COMMENTS_ALERT_LAST_AWAITING'), 
            
                                $this->waiting_approval
            
                            ),
            
                            'reported' => min(
            
                                Configuration::get('COMMENTS_ALERT_LAST_LAST_REPORT'), 
            
                                $this->reported
            
                            )
            
                        ));
            
            
            
                        return $this->display(__FILE__, 'commentsalert.tpl');
            
                    }
            
                }
            
            
            
                public function ajaxUpdateCommentsInfo()
            
                {
            
                    Configuration::updateValue('COMMENTS_ALERT_LAST_AWAITING', $this->waiting_approval);
            
                    Configuration::updateValue('COMMENTS_ALERT_LAST_REPORT', $this->reported);
            
                    die(Tools::jsonEncode(array(
            
                        'waiting_approval' => $this->waiting_approval,
            
                        'reported' => $this->reported
            
                    )));
            
                }
            
            }
    posté dans Bugs & Améliorations
  • RE: Les metas OpenGraph

    @eolia arf le con j'ai tout mélangé.
    Dans Fricadelle, j'avais ajouté les Rich Snippets il y a 9 ans et justement, je regardais hier et je me disais, Top pas d'erreur lol
    je viens de comprendre pourquoi :)

    posté dans Nouvelles fonctionnalités
  • RE: Installation du module Mondial Relay

    @eolia il fonctionne au top !!
    Un grand MERCI

    posté dans Bugs & Améliorations