mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-12 16:30:22 +01:00
Fix /apps/projectmanager threw SQL error Unknown column 'hash' in 'order clause'
This commit is contained in:
parent
769522d57e
commit
e81add6b01
@ -486,12 +486,6 @@ class Storage extends Storage\Base
|
|||||||
*/
|
*/
|
||||||
protected function process_search(&$criteria, &$only_keys=True, &$order_by='', &$extra_cols='', &$wildcard='', &$op='AND', &$filter=null, &$join='')
|
protected function process_search(&$criteria, &$only_keys=True, &$order_by='', &$extra_cols='', &$wildcard='', &$op='AND', &$filter=null, &$join='')
|
||||||
{
|
{
|
||||||
// if no CFs are defined OR used and became unavailable (deleted or permissions changed)
|
|
||||||
if (!$this->customfields && strpos($order_by, self::CF_PREFIX) === false &&
|
|
||||||
strpos(implode(',', array_keys($filter ? $filter : [])), self::CF_PREFIX) === false)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if ($only_keys === false)
|
if ($only_keys === false)
|
||||||
{
|
{
|
||||||
$only_keys = $this->table_name.'.*';
|
$only_keys = $this->table_name.'.*';
|
||||||
@ -588,6 +582,15 @@ class Storage extends Storage\Base
|
|||||||
{
|
{
|
||||||
$col = $this->table_name .'.'.array_search($col, $this->db_cols).' AS '.$col;
|
$col = $this->table_name .'.'.array_search($col, $this->db_cols).' AS '.$col;
|
||||||
}
|
}
|
||||||
|
// Check to make sure our order by doesn't have aliases that won't work
|
||||||
|
else if (stripos($col, 'AS') !== false && $order_by)
|
||||||
|
{
|
||||||
|
list($value, $alias) = explode(' AS ', $col);
|
||||||
|
if(stripos($order_by, $alias) !== FALSE)
|
||||||
|
{
|
||||||
|
$order_by = str_replace($alias, $value, $order_by);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// check if we order by a custom field --> join cf table for given cf and order by it's value
|
// check if we order by a custom field --> join cf table for given cf and order by it's value
|
||||||
|
Loading…
Reference in New Issue
Block a user