From 01893caa610240b48076a315697319a2fd5778aa Mon Sep 17 00:00:00 2001 From: atm-gregr Date: Wed, 8 Dec 2021 14:40:46 +0100 Subject: [PATCH] bad default value --- htdocs/contact/list.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 113fc5e74f7..1672bdd3f7f 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -96,6 +96,7 @@ $search_level = GETPOST("search_level", "array"); $search_stcomm = GETPOST('search_stcomm', 'int'); if ($search_status == '') $search_status = 1; // always display active customer first +if ($search_no_email == '') $search_no_email = -1; $optioncss = GETPOST('optioncss', 'alpha'); @@ -418,7 +419,7 @@ if (count($search_roles) > 0) { $sql .= " AND p.rowid IN (SELECT sc.fk_socpeople FROM ".MAIN_DB_PREFIX."societe_contacts as sc WHERE sc.fk_c_type_contact IN (".implode(',', $search_roles)."))"; } if ($search_no_email != -1 && $search_no_email > 0) $sql .= " AND (SELECT count(*) FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE email = p.email) > 0"; -if ($search_no_email != -1 && $search_no_email == 0) $sql .= " AND (SELECT count(*) FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE email = p.email) = 0"; +if ($search_no_email != -1 && $search_no_email == 0) $sql .= " AND (SELECT count(*) FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE email = p.email) = 0 AND p.email IS NOT NULL AND p.email <> ''"; if ($search_status != '' && $search_status >= 0) $sql .= " AND p.statut = ".$db->escape($search_status); if ($search_import_key) $sql .= natural_search("p.import_key", $search_import_key); if ($type == "o") // filtre sur type