From 7d409f96333f305451c5117dbd7a2ba83ea15816 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 29 Nov 2009 14:38:21 +0000 Subject: [PATCH] Fix: When a constant is defined as a constant for entity 0 and as a constant for entity x, we use entity x (This should not happen except during transition). --- htdocs/core/conf.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/conf.class.php b/htdocs/core/conf.class.php index 7d44cc2d741..f0e545489f1 100644 --- a/htdocs/core/conf.class.php +++ b/htdocs/core/conf.class.php @@ -95,6 +95,7 @@ class Conf $sql.= ",".$db->decrypt('value',$this->db->dolibarr_main_db_encryption,$this->db->dolibarr_main_db_cryptkey)." as value, entity"; $sql.= " FROM ".MAIN_DB_PREFIX."const"; $sql.= " WHERE entity IN (0,".$this->entity.")"; + $sql.= " ORDER BY entity"; // This is to have entity 0 first, then entity 1 that overwrite. $result = $db->query($sql); if ($result) @@ -111,6 +112,7 @@ class Conf { if (! defined("$key")) define ("$key", $value); // In some cases, the constant might be already forced (Example: SYSLOG_FILE during install) $this->global->$key=$value; + // If this is constant for a css file activated by a module if (preg_match('/^MAIN_MODULE_([A-Z_]+)_CSS$/i',$key) && $value) {