• Resolved allan22

    (@allan22)


    Hi
    When I try adding a icon to a user it throws a critical error
    In the logs it says “Invalid user ID 482”
    Location /wp-content/plugins/avatar-privacy/includes/avatar-privacy/core/class-user-fields.php in Avatar_Privacy\Core\User_Fields::set_uploaded_local_avatar at line 290

    Thanks

Viewing 14 replies - 1 through 14 (of 14 total)
  • 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?

    Thread Starter allan22

    (@allan22)

    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.

    Thread Starter allan22

    (@allan22)

    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?

    Thread Starter allan22

    (@allan22)

    For my own user it works fine
    I’m not using anything external for user management

    Thread Starter allan22

    (@allan22)

    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.

    Thread Starter allan22

    (@allan22)

    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.

    Thread Starter allan22

    (@allan22)

    Cool
    Thanks

    Plugin Author pepe

    (@pputzer)

    I have created a GitHub issue to track this.

    Plugin Author pepe

    (@pputzer)

    Will be fixed in 2.7.0.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Invalid user ID when uploading icon’ is closed to new replies.