Merge pull request #4286 from marcosgdf/bug-4055

FIX #4055 SQL error when trying to access a non-existing expedition
This commit is contained in:
Juanjo Menent 2015-12-24 21:58:56 +01:00
commit c9e8c362a5
2 changed files with 2 additions and 2 deletions

View File

@ -841,7 +841,7 @@ class ActionComm extends CommonObject
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."'";
else $sql.= " AND a.fk_element = ".(int) $fk_element." AND a.elementtype = '".$elementtype."'";
}
if (! empty($filter)) $sql.= $filter;
if ($sortorder && $sortfield) $sql.=$db->order($sortfield, $sortorder);

View File

@ -536,7 +536,7 @@ class Expedition extends CommonObject
else
{
dol_syslog(get_class($this).'::Fetch no expedition found', LOG_ERR);
$this->error='Delivery with id '.$id.' not found sql='.$sql;
$this->error='Delivery with id '.$id.' not found';
return 0;
}
}