Jump to content

translation error


Recommended Posts

Hello,

 

 

I have the following warning when I try to translate the email templates in de BO (translations)

 

Warning

: file_exists() [

function.file-exists

]: open_basedir restriction in effect. File(/home/deb0000n2/domains/site.nl/public_html/modules/index.php/mails) is not within the allowed path(s): (/home/deb0000n2/:/tmp:/var/tmp:/usr/local/lib/php/) in

/home/deb0000n2/domains/site.nl/public_html/iadmin/tabs/AdminTranslations.php

 

 

on line

1476

 

Someone an idea ??

 

 

edit

 

The email to admin are in English must in Dutch , but not posible

Link to comment
Share on other sites

  • 2 weeks later...

Hello,

 

I still have no solution for the error, my host-provider knows no solution;

 

Warning : file_exists() [function.file-exists

]: open_basedir restriction in effect. File(/home/deb0000n2/domains/site.nl/public_html/modules/index.php/mails) is not within the allowed path(s): (/home/deb0000n2/:/tmp:/var/tmp:/usr/local/lib/php/) in

/home/deb0000n2/domains/site.nl/public_html/iadmin/tabs/AdminTranslations.php

 

 

it has something to do with the modules e-mails translations:

Link to comment
Share on other sites

hello

 

I read a lot ..example

 

Not the open_basedir settings, but the path that you with the setup of this program is specified to be adapted. If your path starts with '/', this refers to the root, the root directory. You should refer to the root of your account, so / usr / home / debXXXXX / domains / xxxxx.nl / public_html

 

@hopefully you have enough information so you can resolve your problem wiith your hosting company on Monday.

 

:)I thinks so , Thanks for the help ...let you now , when i now more !

Link to comment
Share on other sites

Hello,

 

 

My hoster answer; (hope you can read it)

 

As shown in the error message, try to write in the PrestaShop folder /home/debxxxxn2/domains/xxx.nl/public_html/modules/index.php/mails. This is not a valid directory, but the open_base-dir restriction gives you full access to the folder /home/deb23380n2 / '. The error is perhaps somewhat misleading, that the folder is not accessible is not by open_basedir.

 

It is our unfortunately not clear why the file 'AdminTranslations.php' refers to the folder'mail' and think 'index.php' is a directory. Could you maybe able to go after any reference to the said rule 1476 is used and whether there might be something to adjust it?

 

-------------------------------------------------------------------------------------------------------------------

 

as I (example) AdminTranslations.php rule 1476

 

if ($ module_dir [0]! = '.' AND file_exists ($ _PS_MODULE_DIR_. module_dir. '/ mail'))

 

change in

 

if ($ module_dir [0]! = '.' AND file_exists ($ _PS_MODULE_DIR_. module_dir. /.. / mail '))

 

the error is gone, but I can not translate more mails module in my translations / mails, because they are no longer visible

Link to comment
Share on other sites

Hello,

 

 

My hoster answer; (hope you can read it)

 

As shown in the error message, try to write in the PrestaShop folder /home/debxxxxn2/domains/xxx.nl/public_html/modules/index.php/mails. This is not a valid directory, but the open_base-dir restriction gives you full access to the folder /home/deb23380n2 / '. The error is perhaps somewhat misleading, that the folder is not accessible is not by open_basedir.

 

It is our unfortunately not clear why the file 'AdminTranslations.php' refers to the folder'mail' and think 'index.php' is a directory. Could you maybe able to go after any reference to the said rule 1476 is used and whether there might be something to adjust it?

 

-------------------------------------------------------------------------------------------------------------------

 

as I (example) AdminTranslations.php rule 1476

 

if ($ module_dir [0]! = '.' AND file_exists ($ _PS_MODULE_DIR_. module_dir. '/ mail'))

 

change in

 

if ($ module_dir [0]! = '.' AND file_exists ($ _PS_MODULE_DIR_. module_dir. /.. / mail '))

 

the error is gone, but I can not translate more mails module in my translations / mails, because they are no longer visible

 

$_PS_MODULE_DIR_ is a constant, and should not be coded with a preceding $, i.e. _PS_MODULE_DIR_

Link to comment
Share on other sites

Hello

 

Thanks for comment

 

I copied and pasted the code before yesterday

it is a mystery to me why it was $_PS....., which I now see no more

the error remains

 

this is my code at the moment

 

 

$arr_modules = array();
foreach (scandir(_PS_MODULE_DIR_) AS $module_dir)
{
if ($module_dir[0] != '.' AND file_exists(_PS_MODULE_DIR_.module_dir.'/mails'))
{
$arr_modules[$module_dir] = _PS_MODULE_DIR_.$module_dir;
}

}

Link to comment
Share on other sites

make sure to turn off cache and smarty compile, via performance...and MAKE sure to scroll down and turn off memcache or file system cache if you have it active...then clear your browser cache...and try again...having the $ at some point makes sense with your problem. maybe just re-upload a prestashop AdminTranslate...

Link to comment
Share on other sites

most times it's best to walk away from problems like this, then the answer will present itself...I don't mid looking at it further since all my other 'guesses' proved futile...pm me ftp credentials if you would like me to look at your run-time code..

Link to comment
Share on other sites

  • 6 months later...
  • 4 months later...

Warning

: file_exists() [

function.file-exists

]: open_basedir restriction in effect. File(/home/deb0000n2/domains/site.nl/public_html/modules/index.php/mails) is not within the allowed path(s): (/home/deb0000n2/:/tmp:/var/tmp:/usr/local/lib/php/) in

/home/deb0000n2/domains/site.nl/public_html/iadmin/tabs/AdminTranslations.php

 

Hello!

 

The problem is in:

open_basedir restriction in effect -> in this case, instead of trying to open the file index.php (like folder) and looking /mails. It is known that it will return an error and you have warning. :)

Make a test and delete the moment index.php from /modules. Warning not be displayed.

 

edit: sorry for my woodish english

Edited by waldemar [pl] (see edit history)
Link to comment
Share on other sites

The problem is in the method getModulesHasMails in AdminTranslations.php. The line if ($module_dir[0] != '.' AND file_exists(_PS_MODULE_DIR_.$module_dir.'/mails')) is prefectly valid but the php function scandir in the previous line returns files as well in its result, not only valid directories. This means that the "file_exists" function will be executed for all files and directories in the modules directory. This is what generates the error.

 

The solution: Simply prepend the "files_exists" with an @ and the errors will go away. This is how the line should have looked:

if ($module_dir[0] != '.' AND @file_exists(_PS_MODULE_DIR_.$module_dir.'/mails'))

 

Try it, it'll work.

Link to comment
Share on other sites

Hello,

 

I updated my prestashop a new version 1.4.8.2.

When I go to the BO tools>translation and try to translate name fields this doesn't work. it does not show me the fields for translations. While with all other types of translations everything works perfectly.

Could you help me what is my problem?

 

Thank you!

Edited by hellovelo (see edit history)
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...