Jump to content

Call to undefined method Tools::getmediaserver


Recommended Posts

Bonjour
sur une install toute fraiche d'une v.1.3.2 j'ai dans le back office sur les onglets Modules et paiement cette erreur :

Fatal error: Call to undefined method Tools::getmediaserver() in /home/myhome/www/shop/classes/Module.php(323) : eval()'d code on line 29



cela cause t-il a quelqu'un ?

merci
@+
Philippe

Link to comment
Share on other sites

Pour ceux que cela intéresse, voici la cause :
il s'agissait d'un module clone de blockadvertising
dans lequel je faisais appel à la méthode getmediaserver qui n'est pas encore définie dans le fichier Tools.php de la version 1.3.2.3 de Prestashop

/*if (!file_exists(dirname(__FILE__).'/'.$this->adv_imgname))
           $this->adv_img = _MODULE_DIR_.$this->name.'/pub.jpg';
       else
           $this->adv_img = _MODULE_DIR_.$this->name.'/'.$this->adv_imgname;
       $this->adv_link = htmlentities(Configuration::get('BLOCKADVERT_LINK'), ENT_QUOTES, 'UTF-8');*/

       if (!file_exists(dirname(__FILE__).'/'.$this->adv_imgname))
           $this->adv_img = Tools::getMediaServer($this->name)._MODULE_DIR_.$this->name.'/pub.jpg';
       else
           $this->adv_img = Tools::getMediaServer($this->name)._MODULE_DIR_.$this->name.'/'.$this->adv_imgname;
       $this->adv_link = htmlentities(Configuration::get('BLOCKADVERT_LINK'), ENT_QUOTES, 'UTF-8');



remplacé par

if (!file_exists(dirname(__FILE__).'/'.$this->adv_imgname))
           $this->adv_img = _MODULE_DIR_.$this->name.'/pub.jpg';
       else
           $this->adv_img = _MODULE_DIR_.$this->name.'/'.$this->adv_imgname;
       $this->adv_link = htmlentities(Configuration::get('BLOCKADVERT_LINK'), ENT_QUOTES, 'UTF-8');

       /*if (!file_exists(dirname(__FILE__).'/'.$this->adv_imgname))
           $this->adv_img = Tools::getMediaServer($this->name)._MODULE_DIR_.$this->name.'/pub.jpg';
       else
           $this->adv_img = Tools::getMediaServer($this->name)._MODULE_DIR_.$this->name.'/'.$this->adv_imgname;
       $this->adv_link = htmlentities(Configuration::get('BLOCKADVERT_LINK'), ENT_QUOTES, 'UTF-8');*/

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...