From 634ebaa3b6584f449dab6e17a62ba1d605569a03 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur <eldy@destailleur.fr>
Date: Sat, 21 May 2016 16:01:14 +0200
Subject: [PATCH] Fix into conf.class.php file we must use $this and not $conf

---
 htdocs/core/class/conf.class.php | 34 ++++++++++++++++----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php
index 0b55e2cc814..914c7077c8b 100644
--- a/htdocs/core/class/conf.class.php
+++ b/htdocs/core/class/conf.class.php
@@ -123,8 +123,6 @@ class Conf
 	 */
 	function setValues($db)
 	{
-		global $conf;
-
 		dol_syslog(get_class($this)."::setValues");
 
 		/*
@@ -205,17 +203,19 @@ class Conf
 
 		    $db->free($resql);
 		}
-	        // Include local constants files and fetch their values to the corresponding database constants
-	        if(! empty($this->global->LOCAL_CONSTS_FILES)) {
-	            $filesList = explode(":", $this->global->LOCAL_CONSTS_FILES);
-	            foreach ($filesList as $file) {
-	                $file=dol_sanitizeFileName($file);
-	                include_once DOL_DOCUMENT_ROOT . "/$file/{$file}_consts.php";
-	                foreach ($file2bddconsts as $key=>$value) {
-	                    $conf->global->$key=constant($value);
-	                }
-	            }
-	        }
+		
+        // Include other local consts.php files and fetch their values to the corresponding database constants
+        if (! empty($this->global->LOCAL_CONSTS_FILES)) {
+            $filesList = explode(":", $this->global->LOCAL_CONSTS_FILES);
+            foreach ($filesList as $file) {
+                $file=dol_sanitizeFileName($file);
+                include_once DOL_DOCUMENT_ROOT . "/".$file."/".$file."_consts.php";
+                foreach ($file2bddconsts as $key=>$value) {
+                    $this->global->$key=constant($value);
+                }
+            }
+        }
+
 		//var_dump($this->modules);
 		//var_dump($this->modules_parts['theme']);
 
@@ -398,7 +398,7 @@ class Conf
 			unset($this->global->PROJECT_USE_SEARCH_TO_SELECT);
 		}
 
-		if (! empty($conf->productbatch->enabled))
+		if (! empty($this->productbatch->enabled))
 		{
 			$this->global->STOCK_CALCULATE_ON_BILL=0;
 			$this->global->STOCK_CALCULATE_ON_VALIDATE_ORDER=0;
@@ -419,7 +419,7 @@ class Conf
         $this->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS = 1;
 
         // MAIN_HTML_TITLE
-        if (! isset($conf->global->MAIN_HTML_TITLE)) $conf->global->MAIN_HTML_TITLE='noapp,thirdpartynameonly,contactnameonly,projectnameonly';
+        if (! isset($this->global->MAIN_HTML_TITLE)) $this->global->MAIN_HTML_TITLE='noapp,thirdpartynameonly,contactnameonly,projectnameonly';
         
 		// conf->liste_limit = constante de taille maximale des listes
 		if (empty($this->global->MAIN_SIZE_LISTE_LIMIT)) $this->global->MAIN_SIZE_LISTE_LIMIT=25;
@@ -446,7 +446,7 @@ class Conf
 		// conf->mailing->email_from = email pour envoi par Dolibarr des mailings
 		$this->mailing->email_from=$this->email_from;
 		if (! empty($this->global->MAILING_EMAIL_FROM))	$this->mailing->email_from=$this->global->MAILING_EMAIL_FROM;
-		if (! isset($conf->global->MAIN_EMAIL_ADD_TRACK_ID)) $conf->global->MAIN_EMAIL_ADD_TRACK_ID=1;
+		if (! isset($this->global->MAIN_EMAIL_ADD_TRACK_ID)) $this->global->MAIN_EMAIL_ADD_TRACK_ID=1;
 		
         // Format for date (used by default when not found or not searched in lang)
         $this->format_date_short="%d/%m/%Y";            // Format of day with PHP/C tags (strftime functions)
@@ -579,7 +579,7 @@ class Conf
         		throw new Exception('Log handler does not extend LogHandlerInterface');
         	}
 
-        	if (empty($conf->loghandlers[$handler])) $this->loghandlers[$handler]=$loghandlerinstance;
+        	if (empty($this->loghandlers[$handler])) $this->loghandlers[$handler]=$loghandlerinstance;
         }
 	}
 }
-- 
GitLab