Merge pull request #9095 from IAS-SYSTEMS-CSC/dolibarr-fixes

fix sql error functions.lib.php
This commit is contained in:
Laurent Destailleur 2018-07-15 20:00:54 +02:00 committed by GitHub
commit ba36d1aef0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -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)

View File

@ -130,8 +130,8 @@ $dolibarr_main_url_root_alt=(empty($dolibarr_main_url_root_alt)?'':trim($dolibar
$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';