diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 3c16a67205a..2ec2e5c3253 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -541,7 +541,7 @@ class ActionComm extends CommonObject * @param int $fk_element Id of element action is linked to * @param string $elementtype Type of element action is linked to * @param string $filter Other filter - * @return array <0 if KO, array with actions + * @return array or string Error string if KO, array with actions if OK */ static function getActions($db, $socid=0, $fk_element=0, $elementtype='', $filter='') { @@ -580,9 +580,8 @@ class ActionComm extends CommonObject return $resarray; } else - { - $this->error=$db->lasterror(); - return -1; + { + return $db->lasterror(); } } diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index 04dd81a3da5..cf18ea17974 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -145,7 +145,7 @@ class FormActions require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; $listofactions=ActionComm::getActions($this->db, $socid, $object->id, $typeelement); - if (is_numeric($listofactions) && $listofactions < 0) dol_print_error($this->db,'FailedToGetActions'); + if (! is_array($listofactions)) dol_print_error($this->db,'FailedToGetActions'); $num = count($listofactions); if ($num)