Merge pull request #18676 from FHenry/14_fix_ajax_company_ambious_column

fix: when COMPANY_SHOW_ADDRESS_SELECTLIST is 1 ajax call to company.php is broken
This commit is contained in:
Laurent Destailleur 2021-09-10 19:49:12 +02:00 committed by GitHub
commit d50c518b70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -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 != '') {

View File

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