From c66181a00ee67290d6320738a5200c8335db89a0 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 10 Sep 2021 13:25:40 +0200 Subject: [PATCH] fix: when COMPANY_SHOW_ADDRESS_SELECTLIST is 1 ajax call to company.php is broken --- htdocs/core/class/html.form.class.php | 2 +- htdocs/societe/ajax/company.php | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 98807af1858..d361118b970 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1359,7 +1359,7 @@ class Form $sql .= " AND s.status <> 0"; } if (!empty($excludeids)) { - $sql .= " AND rowid NOT IN (".$this->db->sanitize(join(',', $excludeids)).")"; + $sql .= " AND s.rowid NOT IN (".$this->db->sanitize(join(',', $excludeids)).")"; } // Add criteria if ($filterkey && $filterkey != '') { diff --git a/htdocs/societe/ajax/company.php b/htdocs/societe/ajax/company.php index 76151bccb97..b2578ea6562 100644 --- a/htdocs/societe/ajax/company.php +++ b/htdocs/societe/ajax/company.php @@ -119,10 +119,12 @@ if (!empty($action) && $action == 'fetch' && !empty($id)) { } if (!empty($excludeids)) { - $filter .= 'rowid NOT IN ('.$db->sanitize($excludeids).')'; + $excludeids = explode(',', $excludeids); + } else { + $excludeids = array(); } - $arrayresult = $form->select_thirdparty_list(0, $htmlname, $filter, 1, $showtype, 0, null, $searchkey, $outjson); + $arrayresult = $form->select_thirdparty_list(0, $htmlname, $filter, 1, $showtype, 0, null, $searchkey, $outjson, 0, 'minwidth100', '', false, $excludeids); $db->close();