Skip to content

Commit 385dbc0

Browse files
2 parents 7ba6971 + a4c403e commit 385dbc0

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/services/PeopleSearchService.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ export default class SPPeopleSearchService {
203203
for (const value of values) {
204204
// Only ensure the user if it is not a SharePoint group
205205
if (!value.EntityData || (value.EntityData && typeof value.EntityData.SPGroupID === "undefined" && value.EntityData.PrincipalType !== "UNVALIDATED_EMAIL_ADDRESS")) {
206-
const id = await this.ensureUser(value.Key);
206+
const id = await this.ensureUser(value.Key, siteUrl || this.context.pageContext.web.absoluteUrl);
207207
value.LoginName = value.Key;
208208
value.Key = id;
209209
}
@@ -272,9 +272,10 @@ export default class SPPeopleSearchService {
272272
* Retrieves the local user ID
273273
*
274274
* @param userId
275+
* @param siteUrl
275276
*/
276-
private async ensureUser(userId: string): Promise<number> {
277-
const siteUrl = this.context.pageContext.web.absoluteUrl;
277+
private async ensureUser(userId: string, siteUrl: string): Promise<number> {
278+
// const siteUrl = this.context.pageContext.web.absoluteUrl;
278279
if (this.cachedLocalUsers && this.cachedLocalUsers[siteUrl]) {
279280
const users = this.cachedLocalUsers[siteUrl];
280281
const userIdx = findIndex(users, u => u.LoginName === userId);

0 commit comments

Comments
 (0)