mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-27 13:22:06 +02:00
an other case of not automatic fixed ambigious auto-id
This commit is contained in:
parent
1d6033fb4e
commit
319ae2637c
@ -942,13 +942,19 @@ class Base
|
|||||||
// add table-name to otherwise ambiguous id over which we join (incl. "AS id" to return it with the right name)
|
// add table-name to otherwise ambiguous id over which we join (incl. "AS id" to return it with the right name)
|
||||||
if ($join && $this->autoinc_id)
|
if ($join && $this->autoinc_id)
|
||||||
{
|
{
|
||||||
|
if (!is_array($colums) && strpos($colums, '*') !== false) $colums = explode(',', $colums);
|
||||||
|
if (is_array($colums) && ($key = array_search('*', $colums)) !== false)
|
||||||
|
{
|
||||||
|
unset($colums[$key]);
|
||||||
|
$colums = array_merge($colums, array_keys($this->db_cols));
|
||||||
|
}
|
||||||
if (is_array($colums) && ($key = array_search($this->autoinc_id, $colums)) !== false)
|
if (is_array($colums) && ($key = array_search($this->autoinc_id, $colums)) !== false)
|
||||||
{
|
{
|
||||||
$colums[$key] = $this->table_name.'.'.$this->autoinc_id.' AS '.$this->autoinc_id;
|
$colums[$key] = $this->table_name.'.'.$this->autoinc_id.' AS '.$this->autoinc_id;
|
||||||
}
|
}
|
||||||
elseif (!is_array($colums) && strpos($colums,$this->autoinc_id) !== false)
|
elseif (!is_array($colums) && strpos($colums,$this->autoinc_id) !== false)
|
||||||
{
|
{
|
||||||
$colums = preg_replace('/(?<! AS)([ ,]+)'.preg_quote($this->autoinc_id).'([ ,]+)/','\\1'.$this->table_name.'.'.$this->autoinc_id.' AS '.$this->autoinc_id.'\\2',$colums);
|
$colums = preg_replace('/(?<! AS)([ ,]+)'.preg_quote($this->autoinc_id, '/').'([ ,]+)/','\\1'.$this->table_name.'.'.$this->autoinc_id.' AS '.$this->autoinc_id.'\\2',$colums);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$num_rows = 0; // as spec. in max_matches in the user-prefs
|
$num_rows = 0; // as spec. in max_matches in the user-prefs
|
||||||
|
Loading…
x
Reference in New Issue
Block a user