Make WordPress Core

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#41715 closed defect (bug) (worksforme)

Wrong Site ID in site-users.php

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

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
9 years ago

  • Component General → Users
  • Focuses multisite added

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

with

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

to directly get the site id from the URL.

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

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


9 years ago

#4 @desrosj
9 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
9 years ago

  • Milestone Awaiting Review
  • Resolution → worksforme
  • Status new → closed
  • Version 4.8

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
9 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.