diff --git a/gulliver/thirdparty/creole/drivers/mysql/MySQLConnection.php b/gulliver/thirdparty/creole/drivers/mysql/MySQLConnection.php index 0202cacb0..d3c8a05ee 100755 --- a/gulliver/thirdparty/creole/drivers/mysql/MySQLConnection.php +++ b/gulliver/thirdparty/creole/drivers/mysql/MySQLConnection.php @@ -198,8 +198,16 @@ class MySQLConnection extends ConnectionCommon implements Connection { } }//echo $sql . '

'; $result = @mysql_query($sql, $this->dblink); + if (!$result) { - throw new SQLException('Could not execute query', mysql_error($this->dblink), $sql); + if (!defined('DEBUG_SQL')) { + define('DEBUG_SQL', 0); + } + if (DEBUG_SQL == 1) { + throw new SQLException('Could not execute query', mysql_error($this->dblink), $sql); + } else { + throw new SQLException('It is not possible to execute the query. Please contact your system administrator'); + } } return new MySQLResultSet($this, $result, $fetchmode); } diff --git a/workflow/engine/classes/class.applications.php b/workflow/engine/classes/class.applications.php index 97410fe81..154416a77 100755 --- a/workflow/engine/classes/class.applications.php +++ b/workflow/engine/classes/class.applications.php @@ -21,6 +21,14 @@ class Applications ) { $callback = isset($callback)? $callback : "stcCallback1001"; $dir = isset($dir)? $dir : "DESC"; + + if (isset($sort)) { + G::LoadClass('phpSqlParser'); + $parser = new PHPSQLParser($sort); + $sort = $parser->parsed; + $sort = $sort[''][0]; + } + $sort = isset($sort)? $sort : ""; $start = isset($start)? $start : "0"; $limit = isset($limit)? $limit : "25"; @@ -493,10 +501,10 @@ class Applications //execute the query $oDataset = AppCacheViewPeer::doSelectRS( $Criteria ); - + $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC ); $oDataset->next(); -//g::pr($oDataset); + //g::pr($oDataset); $result = array (); $result['totalCount'] = $totalCount; $rows = array (); diff --git a/workflow/public_html/sysGeneric.php b/workflow/public_html/sysGeneric.php index 96dd851e8..4225e2da2 100755 --- a/workflow/public_html/sysGeneric.php +++ b/workflow/public_html/sysGeneric.php @@ -309,6 +309,7 @@ ini_set( 'soap.wsdl_cache_enabled', $config['wsdl_cache'] ); ini_set( 'date.timezone', $config['time_zone'] ); define( 'DEBUG_SQL_LOG', $config['debug_sql'] ); +define( 'DEBUG_SQL', $config['debug'] ); define( 'DEBUG_TIME_LOG', $config['debug_time'] ); define( 'DEBUG_CALENDAR_LOG', $config['debug_calendar'] ); define( 'MEMCACHED_ENABLED', $config['memcached'] );