Skip to content

Commit

Permalink
pkp#8700 Updated _getSearchSql() method not to generate a SQL with an…
Browse files Browse the repository at this point in the history
… order by clause
jonasraoni committed May 28, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent b6759cc commit b790311
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions classes/security/UserGroupDAO.inc.php
Original file line number Diff line number Diff line change
@@ -544,7 +544,7 @@ function getUsersById($userGroupId = null, $contextId = null, $searchType = null
' . ($userGroupId ? 'AND ug.user_group_id = ?' : '') . '
)';
}
$baseSql .= ' ' . $this->_getSearchSql($searchType, $search, $searchMatch, $params, '');
$baseSql .= ' ' . $this->_getSearchSql($searchType, $search, $searchMatch, $params);

// Get the result set
$result = $this->retrieveRange(
@@ -830,10 +830,9 @@ function deleteSettingsByLocale($locale) {
* @param string $search the keywords to search for.
* @param string $searchMatch where to match (is, contains, startsWith).
* @param array $params SQL parameter array reference
* @param ?string $querySuffix When null adds an ORDER BY clause using the UserDAO::getOrderBy()
* @return string SQL search snippet
*/
function _getSearchSql($searchType, $search, $searchMatch, &$params, $querySuffix = null) {
function _getSearchSql($searchType, $search, $searchMatch, &$params) {
$hasUserSetting = "EXISTS(
SELECT 0
FROM user_settings
@@ -922,8 +921,6 @@ function _getSearchSql($searchType, $search, $searchMatch, &$params, $querySuffi
}
}

$searchSql .= $querySuffix ?? $this->userDao->getOrderBy(); // FIXME Add "sort field" parameter?
return $searchSql;
}

0 comments on commit b790311

Please sign in to comment.