diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index f9a64330ce6..b9cee6b4254 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -8568,7 +8568,7 @@ abstract class CommonObject // For backward compatibility if ($modulepart == 'product') { - if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) { + if (getDolGlobalInt('PRODUCT_USE_OLD_PATH_FOR_PHOTO')) { $dir = $sdir.'/'.get_exdir($this->id, 2, 0, 0, $this, $modulepart).$this->id."/photos/"; $pdir = '/'.get_exdir($this->id, 2, 0, 0, $this, $modulepart).$this->id."/photos/"; } @@ -8590,7 +8590,7 @@ abstract class CommonObject $filearray = dol_dir_list($dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1); - /*if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) // For backward compatiblity, we scan also old dirs + /*if (getDolGlobalInt('PRODUCT_USE_OLD_PATH_FOR_PHOTO')) // For backward compatiblity, we scan also old dirs { $filearrayold=dol_dir_list($dirold,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); $filearray=array_merge($filearray, $filearrayold); diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index a0067925334..a583f07cdb1 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -1146,7 +1146,7 @@ class FormFile } } // For backward compatiblity, we detect file stored into an old path - if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO) && $filearray[0]['level1name'] == 'photos') { + if (getDolGlobalInt('PRODUCT_USE_OLD_PATH_FOR_PHOTO') && $filearray[0]['level1name'] == 'photos') { $relativepath = preg_replace('/^.*\/produit\//', '', $filearray[0]['path']).'/'; } diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 3be3c4c24f7..a9a4459def8 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -319,7 +319,7 @@ function completeFileArrayWithDatabaseInfo(&$filearray, $relativedir) // TODO Remove this when PRODUCT_USE_OLD_PATH_FOR_PHOTO will be removed global $modulepart; - if ($modulepart == 'produit' && !empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) { + if ($modulepart == 'produit' && getDolGlobalInt('PRODUCT_USE_OLD_PATH_FOR_PHOTO')) { global $object; if (!empty($object->id)) { if (isModEnabled("product")) {