forked from extern/egroupware
"replace ambiguous auto-id with (an exact match of) table_name.autoid"
This commit is contained in:
parent
892e22a4a0
commit
bfab75389c
@ -387,6 +387,16 @@ class so_sql_cf extends so_sql
|
||||
$this->db->quote('%'.$criteria[$this->extra_value].'%');
|
||||
unset($criteria[$this->extra_value]);
|
||||
$join .= $this->extra_join;
|
||||
|
||||
// replace ambiguous auto-id with (an exact match of) table_name.autoid
|
||||
if (isset($criteria[$this->autoinc_id]))
|
||||
{
|
||||
if ((int)$criteria[$this->autoinc_id])
|
||||
{
|
||||
$criteria[] = $this->table_name.'.'.$this->autoinc_id.'='.(int)$criteria[$this->autoinc_id];
|
||||
}
|
||||
unset($criteria[$this->autoinc_id]);
|
||||
}
|
||||
}
|
||||
// check if we order by a custom field --> join cf table for given cf and order by it's value
|
||||
if (strpos($order_by,self::CF_PREFIX) !== false &&
|
||||
|
Loading…
Reference in New Issue
Block a user