diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index f7e0ef6acb1..d094fb0bab4 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -683,6 +683,10 @@ class ActionComm extends CommonObject { global $langs; + if (empty($id) && empty($ref) && empty($ref_ext) && empty($email_msgid)) { + return -1; + } + $sql = "SELECT a.id,"; $sql .= " a.id as ref,"; $sql .= " a.entity,"; diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 54e0f87a358..c5dd1045f03 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -526,7 +526,9 @@ class Project extends CommonObject { global $conf; - if (empty($id) && empty($ref)) return -1; + if (empty($id) && empty($ref) && empty($ref_ext) && empty($email_msgid)) { + return -1; + } $sql = "SELECT rowid, entity, ref, title, description, public, datec, opp_amount, budget_amount,"; $sql .= " tms, dateo, datee, date_close, fk_soc, fk_user_creat, fk_user_modif, fk_user_close, fk_statut as status, fk_opp_status, opp_percent,"; diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 5f95c7f0dc5..20d63cea600 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -529,7 +529,7 @@ class Ticket extends CommonObject global $langs; // Check parameters - if (!$id && !$track_id && !$ref && !$email_msgid) { + if (empty($id) && empty($ref) && empty($track_id) && empty($email_msgid)) { $this->error = 'ErrorWrongParameters'; dol_print_error(get_class($this)."::fetch ".$this->error); return -1;