From 6574e54a41e9f2be5aae55c4478767e15b38236b Mon Sep 17 00:00:00 2001 From: ATM john Date: Tue, 4 May 2021 18:09:13 +0200 Subject: [PATCH 1/3] Fix saving template email --- htdocs/admin/mails_templates.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 60a15f4899e..f82e67096eb 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -257,7 +257,7 @@ if (empty($reshook)) $sql = "INSERT INTO ".$tabname[$id]." ("; // List of fields $sql .= $tabfieldinsert[$id]; - $sql .= ",active)"; + $sql .= ",active,enabled)"; $sql .= " VALUES("; // List of values @@ -289,7 +289,7 @@ if (empty($reshook)) $i++; } - $sql .= ", 1)"; + $sql .= ", 1, 1)"; dol_syslog("actionadd", LOG_DEBUG); $result = $db->query($sql); From 139ae3db0025ce86d1898739f3df4e6e7a24ec0a Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Wed, 5 May 2021 11:49:11 +0200 Subject: [PATCH 2/3] FIX: pgsql: prevent 'WHERE 1' --- build/exe/doliwamp/config.inc.php.install | 2 +- htdocs/core/lib/functions.lib.php | 2 +- htdocs/user/class/user.class.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build/exe/doliwamp/config.inc.php.install b/build/exe/doliwamp/config.inc.php.install index 19a3d36a45e..6ad04752766 100644 --- a/build/exe/doliwamp/config.inc.php.install +++ b/build/exe/doliwamp/config.inc.php.install @@ -542,7 +542,7 @@ $cfg['ThemePerServer'] = FALSE; // allow diferent theme for each co * %f will be replaced by a list of field names. * (%t and %f only applies to DefaultQueryTable) */ -$cfg['DefaultQueryTable'] = 'SELECT * FROM %t WHERE 1'; +$cfg['DefaultQueryTable'] = 'SELECT * FROM %t WHERE 1 = 1'; $cfg['DefaultQueryDatabase'] = ''; /** diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index fccb019a730..4148d385716 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -8123,7 +8123,7 @@ function getDictvalue($tablename, $field, $id, $checkentity = false, $rowidfield if (!isset($dictvalues[$tablename])) { $dictvalues[$tablename] = array(); - $sql = 'SELECT * FROM '.$tablename.' WHERE 1'; // Here select * is allowed as it is generic code and we don't have list of fields + $sql = 'SELECT * FROM '.$tablename.' WHERE 1 = 1'; // Here select * is allowed as it is generic code and we don't have list of fields if ($checkentity) $sql .= ' AND entity IN (0,'.getEntity($tablename).')'; $resql = $db->query($sql); diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index cc405571990..89995a4584e 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -3320,7 +3320,7 @@ class User extends CommonObject } else { - $sql .= " WHERE 1"; + $sql .= " WHERE 1 = 1"; } // Manage filter From 63292255ccbc7ad08270bb6820f033f2bc7ed0ff Mon Sep 17 00:00:00 2001 From: ATM john Date: Wed, 5 May 2021 18:45:23 +0200 Subject: [PATCH 3/3] Fix search accented words in product description --- htdocs/societe/consumption.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index cd82533fc88..420282c4cef 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -309,7 +309,7 @@ if (!empty($sql_select)) if ($sref) $sql.= " AND ".$doc_number." LIKE '%".$db->escape($sref)."%'"; if ($sprod_fulldescr) { - $sql.= " AND (d.description LIKE '%".$db->escape($sprod_fulldescr)."%'"; + $sql.= " AND (d.description LIKE '%".$db->escape($sprod_fulldescr)."%' OR d.description LIKE '%".$db->escape(dol_htmlentities($sprod_fulldescr))."%'"; if (GETPOST('type_element') != 'fichinter') $sql.= " OR p.ref LIKE '%".$db->escape($sprod_fulldescr)."%'"; if (GETPOST('type_element') != 'fichinter') $sql.= " OR p.label LIKE '%".$db->escape($sprod_fulldescr)."%'"; $sql.=")";