From e02fe135db0fc071b16fac0c6a595fbab218de59 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 20 Mar 2012 15:28:21 +0100 Subject: [PATCH] Fix: instantiate $mc object at the end --- htdocs/core/class/conf.class.php | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 7c96afd2303..4ca4aff34e9 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -185,19 +185,7 @@ class Conf } $i++; } - - // Object $mc - if (! defined('NOREQUIREMC') && ! empty($this->multicompany->enabled)) - { - global $mc; - - $ret = @dol_include_once('/multicompany/class/actions_multicompany.class.php'); - if ($ret) - { - $mc = new ActionsMulticompany($db); - $mc->setValues($this); - } - } + $db->free($resql); } //var_dump($this->modules); @@ -388,6 +376,19 @@ class Conf // For backward compatibility if ($this->top_menu == 'eldy.php') $this->top_menu='eldy_backoffice.php'; elseif ($this->top_menu == 'rodolphe.php') $this->top_menu='eldy_backoffice.php'; + + // Object $mc + if (! defined('NOREQUIREMC') && ! empty($this->multicompany->enabled)) + { + global $mc; + + $ret = @dol_include_once('/multicompany/class/actions_multicompany.class.php'); + if ($ret) + { + $mc = new ActionsMulticompany($db); + $mc->setValues($this); + } + } } }