Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing Issue - 1669 - PeoplePicker returns no results with webAbsoluteUrl and ensureUser #1693

Closed
wants to merge 1 commit into from
Closed

Conversation

NishkalankBezawada
Copy link
Contributor

Q A
Bug fix? [x]
New feature? [ ]
New sample? [ ]
Related issues? fixes #1669

What's in this Pull Request?

Fixing issue - 1669 - PeoplePicker returns no results with webAbsoluteUrl and ensureUser

Problem statement

When setting webAbsoluteUrl prop to a different site and property to ensureUser = true, results are expected to be returned.
But, No results are fetched, If both the webAbsoluteUrl prop is pointing to a different site than the current one, and ensureUser is set to true, no results are returned in the picker. Instead, the console shows the error: PeopleSearchService::searchTenant: error occured while fetching the users.

272968786-c5580105-3c8c-4551-b143-28220b756b01

A deeper error says Cannot read properties of undefined (reading 'push'), which I've tracked down to PeopleSearchService.ensureUser:295. The object cachedLocalUsers assumes it already contains the webAbsoluteUrl as a key but it does not.

Solution

When checked, in the method ensureUser, the user object is pushed into this.cachedLocalUsers. But this is empty because the user is given webAbsoluteUrl to fetch the users from other site collection, for which it is erroring out as Cannot read properties of undefined (reading push) as shown in the below figure.

image

By checking if this.cachedLocalUsers and initializing it as empty array (as below), this is working as expected.

image

Screenshot with working example

Issue 1669

Thanks,
Nishkalank Bezawada

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant