Plugin Author
pepe
(@pputzer)
What version of WordPress are you on and how do you try to add the icon? For your own user or for someone else? Does it work for other users?
Im trying another user
WP version 6.1.1 but also didn’t work on 6.0
Plugin Author
pepe
(@pputzer)
Can you please describe what you are doing exactly and whether you are the user with that ID or not?
It sounds like you are trying to upload an image for another user as an admin (which should work!), but there’s an issue with the user database.
Im an admin
When I go to any user settings and try to add a profile picture it says “There has been a critical error on this website.”
In the logs it says Invalid user ID *USER_ID*
If it makes a difference, my site is a multi site
Thanks so much for trying to help
Plugin Author
pepe
(@pputzer)
I am running a multisite myself, uploading avatars works fine there (both for myself and for other users). That error says that get_users fails with that user ID. Which should not happen under any foreseeable circumstances. Are you maybe using some alternate backend for user management? Does it work for your own user?
For my own user it works fine
I’m not using anything external for user management
Just investigated further
For my own user it works
When I add to another user from the network settings it does not work but when adding the image in a specific site it does work
Plugin Author
pepe
(@pputzer)
Thanks, that’s something I can investigate. I’ll look into it tomorrow.
Plugin Author
pepe
(@pputzer)
@allan22: I’ve figured out the issue. When you edit user profiles in the Network admin area, it really does so in the context of your primary site (i.e. the site with ID 1 normally). When a user is not associated with the primary site, get_users can’t find them.
Interesting
Thanks so much for checking
Any workaround for that?
Plugin Author
pepe
(@pputzer)
Yeah, edit the users in the context of their site, not from Network for now. I’ll work on a proper fix, but I can’t tell you an ETA yet.
Plugin Author
pepe
(@pputzer)
I have created a GitHub issue to track this.