WordPress.org

Make WordPress Core

Opened 4 months ago

Closed 2 months ago

Last modified 2 months ago

#41715 closed defect (bug) (worksforme)

Wrong Site ID in site-users.php

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

Description

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

Issue :: http://imgur.com/rhArDXv

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 :: http://imgur.com/HWERGkg

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
4 months ago

  • Component changed from General to Users
  • Focuses multisite added

#2 @pluus
4 months 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 ) ?>" />

with

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

to directly get the site id from the URL.

Last edited 4 months ago by pluus (previous) (diff)

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


3 months ago

#4 @desrosj
3 months 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
2 months 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
2 months 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.