Fix load of conf when using alternative $db

This commit is contained in:
Laurent Destailleur 2021-06-26 01:46:14 +02:00
parent 12d591b848
commit 2fd47615eb
2 changed files with 2 additions and 1 deletions

View File

@ -173,7 +173,7 @@ class Conf
{
dol_syslog(get_class($this)."::setValues");
if (!defined('NOREQUIREDB')) {
if (!is_null($db) && is_object($db)) {
// Define all global constants into $this->global->key=value
$sql = "SELECT ".$db->decrypt('name')." as name,";
$sql .= " ".$db->decrypt('value')." as value, entity";

View File

@ -133,6 +133,7 @@ if (!defined('NOREQUIRETRAN')) {
/*
* Object $db
*/
$db = null;
if (!defined('NOREQUIREDB')) {
$db = getDoliDBInstance($conf->db->type, $conf->db->host, $conf->db->user, $conf->db->pass, $conf->db->name, $conf->db->port);