Jump to content

BO : Parse error(s) in module(s)


Recommended Posts

Hi All,

Since 2 days without any explaination the following error occurs when try to acess to Modules tab in back office :

Parse error(s) in module(s) :

atos
bankwire
birthdaypresent
blockadvertising
blockbestsellers
blockcart
blockcategories
blockcurrencies
blockinfos
blocklanguages
etc….

And sure impossible to access to modules. Same result with Payment tab


Please help ! It was planned to open the shop next week...
Thank you for your help.
Fred

Link to comment
Share on other sites

Hi bkorcan,

Thanks for your reply. Do you speak about variable _PS_MODULE_DIR_ into config.inc.php ? if yes, this one is defined as below, the path is good.

define('_PS_MODULE_DIR_', _PS_ROOT_DIR_.'/modules/');

any other idea on this ?

Link to comment
Share on other sites

public static function getModulesOnDisk()
{
$moduleList = array();
$errors = array();
$modules_dir = self::getModulesDirOnDisk();
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;
}

if (sizeof($errors))
{
echo '

'.Tools::displayError('Parse error(s) in module(s)').'

  1. ';
    foreach ($errors AS $error)
    echo '
  2. '.$error.'';
    echo '
';
}
return $moduleList;
}

you may check this function at classes/Module.php
Link to comment
Share on other sites

Thank you very much for this answer, but I am not able to debug it. Modules files are found on disk, it seems that problem happens on eval($file). No code or config change, I really don't understand what happens.

Any other suggestions ?

Thanks
Fred

Link to comment
Share on other sites

Hi tomerg3, I reinstalled all from a backup (exepted the theme) but the pb still occurs. I noticed another thing : all input fields in BO where there is a ' character (ASCII 39) (ex : apar'the) are returned with \' characters (ex : apar\'the). NB : value data in DB are correct

Also into generated html code when you are in FO is the following :
<input type="IMAGE" border="0" src='\"/boutique/modules/atos/logos/CB.gif\"' name="CB"/>

As you can see src var contains \" at the beginning and the end of string, the generated code is wrong, it should be :
<input type="IMAGE" border="0" src='/boutique/modules/atos/logos/CB.gif' name="CB"/>

Any idea about the root cause of this problem
Thanks for your help

Link to comment
Share on other sites

yes I would like to disable them, but I cannot access to modules due to error...

Any hints to do it when we can't access them ?

Thanks


You will have to remove them using ftp, I suggest renaming you current /modules directory to /modules_backup.

Then create a new /modules directory, and start copying them back one by one.
Link to comment
Share on other sites

I removed all modules and add them one by one but the error occurs with any module. I replaced all modules from an previous backup (Jan 03th) but the result is the same, done the same all directories except theme (which is not concerned by BO), again same error. I also compared all files and replaced all modified after the Jan 03th, no more luck...
I am becoming crazy !

Link to comment
Share on other sites

  • 8 months later...

If the site was working fine and then all of a sudden stopped working (without you making any changes) two things to look for would be:

1. modified files

Look for recent date stamps on your site in case anything has been modified. iFrame injection and similar automated exploits are very common and could easily mangle things enough to raise errors.

2. changes in the server setup

Create a phpinfo script:

<?php phpinfo(); ?>



Take a look and make sure that the settings are as you expect. Just because support staff say it is one way does not always mean it actually is (unfortunately).

Cheers

Link to comment
Share on other sites

Thank you both deufg and codegrunt for your help. Problem finally solved. Creating phpinfo script showed that magic_quotes were ON despite the fact that provider wrote me severeal hours ago that it had been OFF. I wrote him back what I think of his skills using strong words.

:))) Thanx guys and greetings from Poland :)))

Link to comment
Share on other sites

×
×
  • Create New...