Redundant bracket in mnu_user.class.inc [message #5902] |
Wed, 28 September 2016 22:50 |
kong
Messages: 90 Registered: December 2011
|
Member |
|
|
File mnu_user.class.inc contains the following function:
function _cm_pre_getData ($where, $where_array, $fieldarray=null)
// perform custom processing before database record(s) are retrieved.
// (WHERE is supplied in two formats - string and array)
// $fieldarray may contain full details of the current record in the parent
// class, not just its primary key.
{
if (empty($this->sql_from)) {
// construct default SELECT and FROM clauses using parent relations
$this->sql_groupby = null;
$this->sql_having = null;
$this->sql_union = null;
$this->sql_from = $this->_sqlForeignJoin($this->sql_select, $this->sql_from, $this->parent_relations);
// retrieve one or more roles from MNU_USER_ROLE
$this->sql_select .= ", (SELECT GROUP_CONCAT(role_desc ORDER BY is_primary DESC, mnu_user_role.role_id ASC SEPARATOR ', ') FROM mnu_user_role LEFT JOIN mnu_role ON (mnu_role.role_id=mnu_user_role.role_id) WHERE user_id=mnu_user.user_id) AS role_list)";
// retrieve primary role from MNU_USER_ROLE
$this->sql_select .= ", (SELECT role_desc FROM mnu_user_role LEFT JOIN mnu_role ON (mnu_role.role_id=mnu_user_role.role_id) WHERE user_id=mnu_user.user_id AND is_primary='Y' LIMIT 1) AS role_id";
} // if
if (!empty($this->sql_search)) {
$search_array = where2array($this->sql_search, false, false);
if (!empty($search_array['role_id'])) {
$role_id = stripOperators($search_array['role_id']);
$search_array[] = "EXISTS(SELECT 1 FROM mnu_user_role WHERE user_id=mnu_user.user_id AND role_id='$role_id')";
unset($search_array['role_id']);
} // if
$this->sql_search = array2where($search_array);
} // if
return $where;
} // _cm_pre_getData Notice the line which ends in That closing bracket should not be there.
|
|
|
|