diff --git a/modules/Settings/Roles/models/Record.php b/modules/Settings/Roles/models/Record.php index 6705129ed..c02826f11 100644 --- a/modules/Settings/Roles/models/Record.php +++ b/modules/Settings/Roles/models/Record.php @@ -83,7 +83,7 @@ public function getChildren() { $parentRoleString = $this->getParentRoleString(); $currentRoleDepth = $this->getDepth(); - $sql = 'SELECT * FROM vtiger_role WHERE parentrole LIKE ? AND depth = ?'; + $sql = 'SELECT * FROM vtiger_role WHERE parentrole LIKE ? AND depth = ? ORDER BY rolename'; $params = array($parentRoleString.'::%', $currentRoleDepth+1); $result = $db->pquery($sql, $params); $noOfRoles = $db->num_rows($result);