Fix check for non-custom modules

The check turned out to be true even for custom modules, causing
the copying of the language file to fail. This attempts to bring
the code behaviour in line with the code explaining it.
This commit is contained in:
Martin Neubauer 2021-11-19 16:38:41 +01:00
parent 92b0fde4ca
commit 4fcac5b53c

View File

@ -742,9 +742,9 @@ if ($dirins && $action == 'addlanguage' && !empty($module)) {
// Dir for module
$diroflang = dol_buildpath($modulelowercase, 0);
if ($diroflang == $dirread.'/'.$modulelowercase) {
if ($diroflang == $dolibarr_main_document_root.'/'.$modulelowercase) {
// This is not a custom module, we force diroflang to htdocs root
$diroflang = $dirread;
$diroflang = $dolibarr_main_document_root;
$srcfile = $diroflang.'/langs/en_US/'.$modulelowercase.'.lang';
$destfile = $diroflang.'/langs/'.$newlangcode.'/'.$modulelowercase.'.lang';