Merge pull request #18013 from nextcloud/bugfix/noid/fix-autocomplete-suggestions-with-numeric-users
Fix autocomplete suggestions with numeric users
This commit is contained in:
commit
1fac8174b9
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -608,7 +608,7 @@
|
||||||
$comment.find('.avatar-name-wrapper').each(function() {
|
$comment.find('.avatar-name-wrapper').each(function() {
|
||||||
var $this = $(this)
|
var $this = $(this)
|
||||||
var $inserted = $this.parent()
|
var $inserted = $this.parent()
|
||||||
var userId = $this.find('.avatar').data('username')
|
var userId = $this.find('.avatar').data('username').toString()
|
||||||
if (userId.indexOf(' ') !== -1) {
|
if (userId.indexOf(' ') !== -1) {
|
||||||
$inserted.html('@"' + userId + '"')
|
$inserted.html('@"' + userId + '"')
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -107,7 +107,7 @@ class AutoCompleteController extends Controller {
|
||||||
foreach ($results as $type => $subResult) {
|
foreach ($results as $type => $subResult) {
|
||||||
foreach ($subResult as $result) {
|
foreach ($subResult as $result) {
|
||||||
$output[] = [
|
$output[] = [
|
||||||
'id' => $result['value']['shareWith'],
|
'id' => (string) $result['value']['shareWith'],
|
||||||
'label' => $result['label'],
|
'label' => $result['label'],
|
||||||
'source' => $type,
|
'source' => $type,
|
||||||
];
|
];
|
||||||
|
|
|
@ -71,7 +71,7 @@ class UserPlugin implements ISearchPlugin {
|
||||||
foreach ($userGroups as $userGroup) {
|
foreach ($userGroups as $userGroup) {
|
||||||
$usersTmp = $this->groupManager->displayNamesInGroup($userGroup, $search, $limit, $offset);
|
$usersTmp = $this->groupManager->displayNamesInGroup($userGroup, $search, $limit, $offset);
|
||||||
foreach ($usersTmp as $uid => $userDisplayName) {
|
foreach ($usersTmp as $uid => $userDisplayName) {
|
||||||
$users[$uid] = $userDisplayName;
|
$users[(string) $uid] = $userDisplayName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -80,7 +80,7 @@ class UserPlugin implements ISearchPlugin {
|
||||||
|
|
||||||
foreach ($usersTmp as $user) {
|
foreach ($usersTmp as $user) {
|
||||||
if ($user->isEnabled()) { // Don't keep deactivated users
|
if ($user->isEnabled()) { // Don't keep deactivated users
|
||||||
$users[$user->getUID()] = $user->getDisplayName();
|
$users[(string) $user->getUID()] = $user->getDisplayName();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -94,6 +94,7 @@ class UserPlugin implements ISearchPlugin {
|
||||||
$foundUserById = false;
|
$foundUserById = false;
|
||||||
$lowerSearch = strtolower($search);
|
$lowerSearch = strtolower($search);
|
||||||
foreach ($users as $uid => $userDisplayName) {
|
foreach ($users as $uid => $userDisplayName) {
|
||||||
|
$uid = (string) $uid;
|
||||||
if (strtolower($uid) === $lowerSearch || strtolower($userDisplayName) === $lowerSearch) {
|
if (strtolower($uid) === $lowerSearch || strtolower($userDisplayName) === $lowerSearch) {
|
||||||
if (strtolower($uid) === $lowerSearch) {
|
if (strtolower($uid) === $lowerSearch) {
|
||||||
$foundUserById = true;
|
$foundUserById = true;
|
||||||
|
|
|
@ -392,7 +392,7 @@ class Manager extends PublicEmitter implements IGroupManager {
|
||||||
|
|
||||||
$matchingUsers = [];
|
$matchingUsers = [];
|
||||||
foreach ($groupUsers as $groupUser) {
|
foreach ($groupUsers as $groupUser) {
|
||||||
$matchingUsers[$groupUser->getUID()] = $groupUser->getDisplayName();
|
$matchingUsers[(string) $groupUser->getUID()] = $groupUser->getDisplayName();
|
||||||
}
|
}
|
||||||
return $matchingUsers;
|
return $matchingUsers;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue