Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#41715 closed defect (bug) (worksforme)

Wrong Site ID in site-users.php

Reported by: pluus's profile pluus Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Users Keywords: reporter-feedback
Focuses: multisite Cc:


I’ve found a weird glitch in wp-admin/network/site-users.php.

Issue ::

Whenever I was trying to add a user to a site, it was complaining that the requested site doesn’t exist. While investigating it, I’ve found that the $id value changes after the user table is displayed.

Fixed ::

After disabling #270, the wrong id issue was fixed. All I can assume at this stage is that the function to display the user table is corrupting $id somehow.

Is this a known issue?

Change History (6)

#1 @SergeyBiryukov
7 years ago

  • Component changed from General to Users
  • Focuses multisite added

#2 @pluus
7 years ago

Since the table is a must have thing... I've replaced the following code
<input type="text" name="id" value="<?php echo esc_attr( $id ) ?>" />


<input type="text" name="id" value="<?php echo esc_attr( $_REQUEST [ 'id' ] ) ?>" />

to directly get the site id from the URL.

Last edited 7 years ago by pluus (previous) (diff)

This ticket was mentioned in Slack in #core-multisite by desrosj. View the logs.

7 years ago

#4 @desrosj
7 years ago

  • Keywords reporter-feedback added

Hey @pluus, welcome to Trac!

I was unable to reproduce the behavior that you described. When I am on wp-admin/network/site-users.php, the field has the correct ID.

Are you using any plugins when you see this behavior?

Also, in the page's output, there should be a localized JavaScript variable, current_site_id. Can you view source and see if that has the correct value in it?

#5 @jeremyfelt
7 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed
  • Version 4.8 deleted

I'm going to go ahead and close this as worksforme. @pluus, if you are still having this issue and can reproduce it without plugins activated, please feel free to comment and reopen if needed.

#6 @pluus
7 years ago

Sorry for the late reply. Please go ahead close it for now. I will investigate plugins the website is using. Thanks.

Note: See TracTickets for help on using tickets.