Skip to content

Conversation

@wildangunawan
Copy link

@wildangunawan wildangunawan commented Apr 17, 2025

This PR fixes issue #115 and its duplicate.

Issue:

  1. MS Graph return a 404 Error with JSON body when user doesn't have a profile picture.

When doesn't have profile picture
image

When have profile picture
image

Solution:

  1. Check whether the returned body is a JSON or a File.
  2. If JSON, skip the processing by returning false.
  3. If a File, continue the process.

Better solution:

  1. Check whether returned is 200 OK or not.
  2. If not 200 OK then return false.

Ps. I'm not too familiar with GLPI Toolbox so not sure if we're able to check returned status or not. Will try to keep digging for this.

skip photo processing if user has no profile picture
@eduardomozart
Copy link
Collaborator

Hello @wildangunawan, thank you for your contribution.
As cited on your code, if it's possible to check it's HTTP status, it's better as it would be easier to port it to other providers, so this PR will not be merged until this possibility is tested.

@silex-ymaimponte
Copy link

Hi,

Thanks for the PR, we agree that the issue is not yet fixed?

Thanks

@eduardomozart
Copy link
Collaborator

The solution at #125 seems better than this PR since it can be used to test image photo from other providers.

@rfcdejong
Copy link

We run into the same issue. Would be nice to have this PR merged into the code base.

@eduardomozart
Copy link
Collaborator

eduardomozart commented Sep 4, 2025

I'll be reimplementing GLPI next week into my instance, so I plan to fix the login issues reported, merge the PRs to the codebase, and release a new version of the plugin.

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.

4 participants