2
0
forked from Wavyzz/dolibarr

Change 0 and 1 to FALSE and TRUE for pgsql

0 and 1 are read as False and True by Mysql, but not by PGsql.
FALSE and TRUE are correctly read by both => changing
This commit is contained in:
Vaadasch
2019-07-28 17:51:15 +02:00
committed by Laurent Destailleur
parent e54c6fb5e2
commit 1600ecc9ec

View File

@@ -1445,13 +1445,13 @@ class ExtraFields
$InfoFieldList[4] = str_replace('$ID$', '0', $InfoFieldList[4]); $InfoFieldList[4] = str_replace('$ID$', '0', $InfoFieldList[4]);
} else { } else {
if (!empty($matchCondition[1])) { if (!empty($matchCondition[1])) {
$boolCond = (($matchCondition[1] == "AND") ? ' AND 1 ' : ' OR 0 '); $boolCond = (($matchCondition[1] == "AND") ? ' AND TRUE ' : ' OR FALSE ');
$InfoFieldList[4] = str_replace($matchCondition[0], $boolCond . $matchCondition[3], $InfoFieldList[4]); $InfoFieldList[4] = str_replace($matchCondition[0], $boolCond . $matchCondition[3], $InfoFieldList[4]);
} elseif (!empty($matchCondition[3])) { } elseif (!empty($matchCondition[3])) {
$boolCond = (($matchCondition[3] == "AND") ? ' 1 AND ' : ' 0 OR'); $boolCond = (($matchCondition[3] == "AND") ? ' TRUE AND ' : ' FALSE OR');
$InfoFieldList[4] = str_replace($matchCondition[0], $boolCond, $InfoFieldList[4]); $InfoFieldList[4] = str_replace($matchCondition[0], $boolCond, $InfoFieldList[4]);
} else { } else {
$InfoFieldList[4] = 1; $InfoFieldList[4] = " TRUE ";
} }
} }