Skip to content
This repository was archived by the owner on Aug 18, 2026. It is now read-only.
This repository was archived by the owner on Aug 18, 2026. It is now read-only.

Changing user profile fields in Multisite causes error #3830

Open

Description

@dariusk

When I change any field in a user profile, I see the following error in a Multisite installation of Newspack 6.0.2:

Fatal error:  Uncaught Error: Call to undefined function  Newspack\get_user() in  /web/dev/phpdev/docs/bkc-blogs/wp-content/plugins/newspack-plugin/includes/plugins/co-authors-plus/class-nicename-change.php:209 
Stack trace: 
#0 /web/dev/phpdev/docs/bkc-blogs/wp-includes/class-wp-hook.php(326):  Newspack\Nicename_Change::profile_update() 
#1 /web/dev/phpdev/docs/bkc-blogs/wp-includes/class-wp-hook.php(348):  WP_Hook->apply_filters() 
#2 /web/dev/phpdev/docs/bkc-blogs/wp-includes/plugin.php(517):  WP_Hook->do_action() 
#3 /web/dev/phpdev/docs/bkc-blogs/wp-includes/user.php(2509):  do_action() 
#4 /web/dev/phpdev/docs/bkc-blogs/wp-includes/user.php(2632):  wp_insert_user() 
#5 /web/dev/phpdev/docs/bkc-blogs/wp-admin/includes/user.php(233):  wp_update_user() 
#6 /web/dev/phpdev/docs/bkc-blogs/wp-admin/user-edit.php(171):  edit_user() 
#7 /web/dev/phpdev/docs/bkc-blogs/wp-admin/profile.php(18):  require_once('...') 
#8 {main}  thrown in **/web/dev/phpdev/docs/bkc-blogs/wp-content/plugins/newspack-plugin/includes/plugins/co-authors-plus/class-nicename-change.php** on line **209**`

The change is applied correctly but the error appears as a splash screen after submission!

To Reproduce
Steps to reproduce the behavior:

  1. Install Newspack 6.0.2 on a Multisite installation
  2. Log in to the dashboard
  3. Select Users -> Profile
  4. Change any field on the profile like "Website" or "First Name"
  5. Press "Update Profile"
  6. Observe the above error in a splash screen
  7. Press the browser back button
  8. Observe that the change was correctly applied

Expected behavior
I expect the profile editing page to reload with the "Profile updated." banner at the top

Notes
I'm not a Wordpress dev but I'm guessing that get_user here might be making some assumptions about how to get a user in a multisite installation?

Activity

  1. Takshil-Kunadia commented on Apr 24, 2025

    @Takshil-Kunadia
    Collaborator

    Thanks @dariusk, I attempted to replicate this issue locally in order to debug it, but I was unable to reproduce the error. Here’s a screen recording of my attempt:

    Screen.Recording.2025-04-24.at.11.12.14.AM.mov

    Based on the stack trace you provided, it appears the error may be caused by a namespace conflict. Specifically, WordPress provides a global get_user() utility function that many plugins rely on to fetch user data. However, the stack trace suggests that the call to get_user() is being interpreted as a method within the Newspack namespace (e.g., Newspack\get_user()), rather than referencing the global function. Are you still facing the issue? if so we can probe further.
    Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions