YannickRe / spfx-msgraph-peoplesearch

Show and search users from your organization with an SPFx web part, through Microsoft Graph.
40 stars 33 forks source link

Issue displaying user photos #14

Closed Bayliss1 closed 3 years ago

Bayliss1 commented 3 years ago

Hi,

I have managed to implement the web part into our intranet and it is working great, however the one issue we are having is that it is not pulling all user photos, only some.

All of our users are on Exchange Online, and most do have photos - these show both in Azure and when running the GET "https://graph.microsoft.com/beta/users/UserIdOrPrincipalName/photo/$value" query in the MS Graph Developer area

Are you able to provide any ideas as to why this may be happening please?

Thanks

YannickRe commented 3 years ago

If the photos are missing in the web part, but it works when executing in Graph Explorer then I suggest you go look at the network requests.

Bayliss1 commented 3 years ago

Thanks for the response.

I think it may be if the user has logged into Microsoft Delve, then that overwrites the profile picture in the People Search with the Delve default initials profile picture.

When a user uploads their profile picture on Delve, it instantly appears in the People Search.

I wasn't expecting Delve photos to take priority over the Exchange Online ones, so thought it may be an issue

Bayliss1 commented 3 years ago

Hi,

First off, massive thanks for the web part - it (nearly) works perfectly and is fantastic quality.

We are having an issue with the persona cards, users photos are not appearing - even if their photo DOES appear in the main people search. Please see an example below, most/all all of the users in the image below (inlcuding the one selected) have uploaded a photo to Delve weeks ago, which has now synced across the entire O365 suite and is also showing their photos in the main people search.

Screenshot_2

But as you can see, it just displays their initials.

Any help would be massively appreciated, I'm struggling to figure it out!

Thanks

Bayliss1 commented 3 years ago

Looking at the User Profiles area within the Sharepoint admin centre, the photos in there are just grey avatar icons for all the affected users.

I have been trying to research but cannot find a proper answer on how to force a sync so that the photos in User Profiles get updated.

Thanks

YannickRe commented 3 years ago

I'm afraid I cannot help you there. The people card uses the SharePoint UserProfile pictures, and if these aren't available then you get only the initials. It's a long standing issue that it is unclear on how you can get Graph user profile pictures quickly into SharePoint. If you cannot figure it out, I suggest you log an issue at https://github.com/SharePoint/sp-dev-docs