Jump to content

[Solved] Back office mobules gone


Recommended Posts

there are filtering conditions in the module pages. maybe it just filtering issue. if this is the case try to click on the "reset" button.

If the modules page is empty, there must be some error happen. Follow Michaël's suggestion to show the errors.

Link to comment
Share on other sites

If you don't see the reset button, that mean you have to follow my suggestions :

open config/config.inc.php and

replace

ini_set('display_errors','off');
by
ini_set('display_errors','On');
error_reporting(E_ALL);

Link to comment
Share on other sites

So it seems your php file classes/Tools.php is not correct. When I see mine, the method getProtocol exists.

Maybe you try to use a module too recent for your PrestaShop version. I can see you're using 1.3.3.0, You should upgrade.

Link to comment
Share on other sites

But i haven't added a module i just got the person how hosts my site to upgrade it to 1.4.2 that's when it all went wrong so he put it back to the original settings of 1.3.3 and that when the modules disappeared but it all worked fine before he tried to upgrade.

Link to comment
Share on other sites

So that mean maybe he didn't removed the added modules. Let me explains how the Module tab works (in 1.3.x version) :

When you go on that tab, all modules/[module-name]/[module-name].php files are evaluated to see if there is an error in the php code. This way, it's impossible to enable not working modules.

On your particular example a module need the static method Tools::getProtocol() to works, and it doesn't exists.

If you want to see which one doesn't work, you can edit the files classes/Module.php as following :

Find the method "getModulesOnDisk" (around line 311 for me but I opened the 1.3.7 file, so that can differ).
Find

if (class_exists($module, false) OR eval($file) !== false)


replace by

echo "$module
";
if (class_exists($module, false) OR eval($file) !== false)


Save and send your edited files to your server.

Check again your admin > module tab, you will see all successfully loaded module names, and at the last position the not working module.

rename its directory by adding "not-working" at the end of its name, or simply delete it.

Check again and if this is ok, remove what you added in Module.php file (the "echo" thing)

Edit : a 2nd solution is to ask to the person who made the revert to do that :)

Link to comment
Share on other sites

Hi
i have done that and got this

addheader
authorizeaim
bankwire
birthdaypresent
blockadvertising
blockbestsellers
blockcart
blockcategories
blockcms
blockcurrencies
blockfblikebox
blockhomenews
blockinfos
blocklanguages
blocklayered
blocklink
blockmanufacturer
blockmenulavalamp
blockmyaccount
blocknewproducts
blocknewsletter
blockpaymentlogo
blockpermanentlinks
blockpselivezilla
blockrss
blockrss2
blocksearch
blockslidingcategories
blockspecials
blockspecialscarousel
blocksupplier
blocktags
blocktopmenu
blockuserinfo
blockvariouslinks
blockviewed
blockwishlist
canonicalurl
carouselnc
carriercompare
cashondelivery
cashticket
cheque
cornerplubli
creditcard
criteo
crossselling
cs_livehelp
dateofdelivery
dejala
dibs

Fatal error: Call to undefined method Tools::getProtocol() in /home/onestopa/public_html/classes/Module.php(324) : eval()'d code on line 106

Link to comment
Share on other sites

Deleted it and got this.

Warning: require_once(/home/onestopa/public_html/config/../classes/CarrierModule.php) [function.require-once]: failed to open stream: No such file or directory in /home/onestopa/public_html/config/config.inc.php on line 21

Fatal error: require_once() [function.require]: Failed opening required '/home/onestopa/public_html/config/../classes/CarrierModule.php' (include_path='.:/usr/lib/php:/usr/local/lib/php:/usr/local/lib/php/ZendGdata-1.11.0/library') in /home/onestopa/public_html/config/config.inc.php on line 21

Link to comment
Share on other sites

Deleted it and got this.

Warning: require_once(/home/onestopa/public_html/config/../classes/CarrierModule.php) [function.require-once]: failed to open stream: No such file or directory in /home/onestopa/public_html/config/config.inc.php on line 21

Fatal error: require_once() [function.require]: Failed opening required '/home/onestopa/public_html/config/../classes/CarrierModule.php' (include_path='.:/usr/lib/php:/usr/local/lib/php:/usr/local/lib/php/ZendGdata-1.11.0/library') in /home/onestopa/public_html/config/config.inc.php on line 21


Have you put the right 1.4 modules on your server and got this messages?
Link to comment
Share on other sites

Ok, let's try an other method.

Do the following.

Find in Module.php:

       foreach ($modules_dir AS $module)
       {
           $file = trim(file_get_contents(_PS_MODULE_DIR_.'/'.$module.'/'.$module.'.php'));
           if (substr($file, 0, 5) == '<?php')
               $file = substr($file, 5);
           if (substr($file, -2) == '?>')
               $file = substr($file, 0, -2);
           if (class_exists($module, false) OR eval($file) !== false)
               $moduleList[] = new $module;
           else
               $errors[] = $module;
       }



Now, replace

            if (class_exists($module, false) OR eval($file) !== false)
               $moduleList[] = new $module;
           else
               $errors[] = $module;


By

try
{            if (class_exists($module, false) OR eval($file) !== false)
               $moduleList[] = new $module;
           else
               $errors[] = $module;
}
catch(Exception $e)
{

die("Hey ! $module can't work (error $e)! Delete it right now.");
}

Link to comment
Share on other sites

now i get this

Parse error: syntax error, unexpected '?' in /home/onestopa/public_html/classes/Module.php(325) : eval()'d code on line 1

Fatal error: Class 'ImportModule' not found in /home/onestopa/public_html/classes/Module.php(325) : eval()'d code on line 5

Link to comment
Share on other sites

If you delete it, put again the "echo" thing, and then try to understood what you're doing !


Or, contact the person who restored your site and give him a link to this topic, he will understand what's wrong.

Regards,

Link to comment
Share on other sites

  • 4 weeks later...
So that mean maybe he didn't removed the added modules. Let me explains how the Module tab works (in 1.3.x version) :

When you go on that tab, all modules/[module-name]/[module-name].php files are evaluated to see if there is an error in the php code. This way, it's impossible to enable not working modules.

On your particular example a module need the static method Tools::getProtocol() to works, and it doesn't exists.

If you want to see which one doesn't work, you can edit the files classes/Module.php as following :

Find the method "getModulesOnDisk" (around line 311 for me but I opened the 1.3.7 file, so that can differ).
Find
if (class_exists($module, false) OR eval($file) !== false)


replace by

echo "$module
";
if (class_exists($module, false) OR eval($file) !== false)


Save and send your edited files to your server.

Check again your admin > module tab, you will see all successfully loaded module names, and at the last position the not working module.

rename its directory by adding "not-working" at the end of its name, or simply delete it.

Check again and if this is ok, remove what you added in Module.php file (the "echo" thing)

Edit : a 2nd solution is to ask to the person who made the revert to do that :)



Thank you, your advise was a real lifesaver kudos to you!
Link to comment
Share on other sites

Hey!

I have the same issue with the Dibs module. Is it really true, that it's not compatible with PrestaShop 1.3.x? It says so in the addons page, but I have the same issue.

PHP Fatal error: Call to undefined method Tools::getprotocol() in /var/www/myserver/domains/www.testsite/classes/Module.php(323) : eval()'d code on line 103

Thanks

-M

Link to comment
Share on other sites

Hi MTrabjerg,

Dibs must work with PS 1.3.

You can add these functions in file classes/Tools.php. And It will work.

   /**
    * getProtocol return the set protocol according to configuration (http[s])
    * @param Boolean true if require ssl
    * @return String (http|https)
    */
   public static function getProtocol($use_ssl = null)
   {
       return (!is_null($use_ssl) && $use_ssl ? 'https://' : 'http://');
   }



Regards,

Link to comment
Share on other sites

  • 2 weeks later...
Hi MTrabjerg,

Dibs must work with PS 1.3.

You can add these functions in file classes/Tools.php. And It will work.

   /**
    * getProtocol return the set protocol according to configuration (http[s])
    * @param Boolean true if require ssl
    * @return String (http|https)
    */
   public static function getProtocol($use_ssl = null)
   {
       return (!is_null($use_ssl) && $use_ssl ? 'https://' : 'http://');
   }



Regards,



Where exactly are these lines of code to be inserted? At the very beginning or what?

Thanks :)
Link to comment
Share on other sites

Hi Nondo,

Just after

class ToolsCore
{



Simpler and cleaner, you can add a file in override/classes, named Tools.php with this content:

class Tools extends ToolsCore
{
   /**
    * getProtocol return the set protocol according to configuration (http[s])
    * @param Boolean true if require ssl
    * @return String (http|https)
    */
   public static function getProtocol($use_ssl = null)
   {
       return (!is_null($use_ssl) && $use_ssl ? 'https://' : 'http://');
   }
}

Link to comment
Share on other sites

  • 5 years later...

hi guys

i update my presta to the last version but i have some error in module part like this:

PrestaShop] Fatal error in module file :/home/fcbuyir/domains/fcbuy.ir/public_html/classes/module/Module.php(1361) : eval()'d code:
syntax error, unexpected end of file

 

can anyone help me?

Thanks

Link to comment
Share on other sites

×
×
  • Create New...