From 076bf0a3a709ee29d74ec423980eadd2a4ffd710 Mon Sep 17 00:00:00 2001 From: ias-ceo Date: Thu, 12 Jul 2018 05:09:36 +0300 Subject: [PATCH 1/3] fix sql error --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 1cce0c387721d..e5def24be2df7 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7576,7 +7576,7 @@ function getDictvalue($tablename, $field, $id, $checkentity=false, $rowidfield=' { $dictvalues[$tablename] = array(); $sql = 'SELECT * FROM '.$tablename.' WHERE 1'; - if ($checkentity) $sql.= ' entity IN (0,'.getEntity('').')'; + if ($checkentity) $sql.= ' and entity IN (0,'.getEntity('').')'; $resql = $db->query($sql); if ($resql) From 740f35966ce8f81b47d3e73996d5eb396bad8eff Mon Sep 17 00:00:00 2001 From: ias-ceo Date: Thu, 12 Jul 2018 05:15:09 +0300 Subject: [PATCH 2/3] installation default port number if missing --- htdocs/filefunc.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index ce83e3a3460f3..18c5dd4962a98 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -130,8 +130,8 @@ $dolibarr_main_document_root=trim($dolibarr_main_document_root); $dolibarr_main_document_root_alt=(empty($dolibarr_main_document_root_alt)?'':trim($dolibarr_main_document_root_alt)); -if (empty($dolibarr_main_db_port)) $dolibarr_main_db_port=0; // Pour compatibilite avec anciennes configs, si non defini, on prend 'mysql' -if (empty($dolibarr_main_db_type)) $dolibarr_main_db_type='mysqli'; // Pour compatibilite avec anciennes configs, si non defini, on prend 'mysql' +if (empty($dolibarr_main_db_port)) $dolibarr_main_db_port=3306; // For compatibility with old configs, if not defined, we take 'mysql' type +if (empty($dolibarr_main_db_type)) $dolibarr_main_db_type='mysqli'; // For compatibility with old configs, if not defined, we take 'mysql' type // Mysql driver support has been removed in favor of mysqli if ($dolibarr_main_db_type == 'mysql') $dolibarr_main_db_type = 'mysqli'; From 0ca9f6f52234f0e1db482bc5201b8406d0823a7e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 15 Jul 2018 20:00:43 +0200 Subject: [PATCH 3/3] Update functions.lib.php --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index e5def24be2df7..a3e1ac50e1876 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7576,7 +7576,7 @@ function getDictvalue($tablename, $field, $id, $checkentity=false, $rowidfield=' { $dictvalues[$tablename] = array(); $sql = 'SELECT * FROM '.$tablename.' WHERE 1'; - if ($checkentity) $sql.= ' and entity IN (0,'.getEntity('').')'; + if ($checkentity) $sql.= ' AND entity IN (0,'.getEntity('').')'; $resql = $db->query($sql); if ($resql)