Skip to content
Snippets Groups Projects
Commit c9e8c362 authored by Juanjo Menent's avatar Juanjo Menent
Browse files

Merge pull request #4286 from marcosgdf/bug-4055

FIX #4055 SQL error when trying to access a non-existing expedition
parents 2d3915b8 d30c6441
No related branches found
No related tags found
No related merge requests found
...@@ -841,7 +841,7 @@ class ActionComm extends CommonObject ...@@ -841,7 +841,7 @@ class ActionComm extends CommonObject
if (! empty($elementtype)) if (! empty($elementtype))
{ {
if ($elementtype == 'project') $sql.= ' AND a.fk_project = '.$fk_element; 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 (! empty($filter)) $sql.= $filter;
if ($sortorder && $sortfield) $sql.=$db->order($sortfield, $sortorder); if ($sortorder && $sortfield) $sql.=$db->order($sortfield, $sortorder);
......
...@@ -536,7 +536,7 @@ class Expedition extends CommonObject ...@@ -536,7 +536,7 @@ class Expedition extends CommonObject
else else
{ {
dol_syslog(get_class($this).'::Fetch no expedition found', LOG_ERR); 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; return 0;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment