diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php
index 0a6c0381e9083f6ab2304c5076bef8e2f17bb3ec..030ad81f28b8123307993fd206ae7041fa7db39e 100644
--- a/htdocs/comm/action/class/actioncomm.class.php
+++ b/htdocs/comm/action/class/actioncomm.class.php
@@ -401,15 +401,15 @@ class ActionComm extends CommonObject
 		$sql = "SELECT a.id";
 		$sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a";
 		$sql.= " WHERE a.entity = ".$conf->entity;
-		if ($socid) $sql.= " AND a.fk_soc = ".$socid;
-		if ($elementtype!='')
+		if (! empty($socid)) $sql.= " AND a.fk_soc = ".$socid;
+		if (! empty($elementtype))
 		{
 			if ($elementtype == 'project') $sql.= ' AND a.fk_project = '.$fk_element;
 			else $sql.= " AND a.fk_element = ".$fk_element." AND a.elementtype = '".$elementtype."'";
 		}
-		if ($filter) $sql.= $filter;
+		if (! empty($filter)) $sql.= $filter;
 
-		dol_syslog("ActionComm::fetchAll sql=".$sql);
+		dol_syslog("ActionComm::getActions sql=".$sql);
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{