Make WordPress Core

Opened 10 years ago

Last modified 5 years ago

#27743 assigned defect (bug)

"Change role to..." omitted from bottom of users table shown to single site admin in multi-site

Reported by: sootsnoot's profile sootsnoot Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.7
Component: Users Keywords: needs-patch
Focuses: ui, multisite Cc:

Description

For more background, see multisite forum discussion https://wordpress.org/support/topic/how-can-a-multisite-site-admin-change-a-users-role?replies=6#post-5437492 where the mod thought this might be worth a ticket.

Browsing the current sources for trunk, I can see that the problem is present at line 206: https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/class-wp-users-list-table.php#L206

My personal feeling is that even for filtering controls, having them present in the line of controls at the top of tables but absent in the line at the bottom of the tables is not a good idea, but I'll concede that it's debatable.

However, I believe that for this case of showing the "Change role to..." bulk action at the top of the users shown to single-site admins in a multi-site network, but omitting it from the bottom of the table, where it clearly ought to be present beside the Bulk Actions control, is a bug.

The attached screenshot shows the problem (using 3.7.1). Deleting these lines from the trunk version of class-wp-users-list-table.php fixes the problem (tested in 3.7.1).

Attachments (3)

Change-role.jpg (24.3 KB) - added by sootsnoot 10 years ago.
screenshot showing the missing control at the bottom of the users table
27743.diff (527 bytes) - added by hiwhatsup 10 years ago.
I added logic to check variable $which for both "top" and "bottom" to display "Change role to..." dropdown in user table
27743.2.diff (2.8 KB) - added by wonderboymusic 9 years ago.

Download all attachments as: .zip

Change History (16)

@sootsnoot
10 years ago

screenshot showing the missing control at the bottom of the users table

#1 @sootsnoot
10 years ago

Urgg, I forgot to include the lines to be deleted. The trunk version of class-wp-users-list-table.php has:

205	        function extra_tablenav( $which ) {
206	                if ( 'top' != $which )
207	                        return;
208	        ?

Deleting lines 206 and 207 solves the problem.

Last edited 10 years ago by sootsnoot (previous) (diff)

#2 @SergeyBiryukov
10 years ago

  • Component changed from General to Users
  • Version changed from 3.7.1 to 2.7

"Change role to..." dropdown was added in [6990].

"Bulk Actions" dropdown was added to table footer in [9028].

#3 @hiwhatsup
10 years ago

My opinion I would have to agree that from a UI standpoint it feels like a bug. Is there some reasoning why "Change role to..." was left from the bottom with version 3.1.0 that's not apparent now multiple versions later?

If it is decided to add "Change role to..." to the bottom. Is it the best strategy to delete line 206 and 207? Or maybe just a add logic to check for "bottom" in case the "extra_tablenav" function is called (or will be called ) elsewhere?

	protected function extra_tablenav( $which ) {
		if ( 'top' != $which  && 'bottom' != $which )
			return;

@hiwhatsup
10 years ago

I added logic to check variable $which for both "top" and "bottom" to display "Change role to..." dropdown in user table

#4 @hiwhatsup
10 years ago

  • Keywords has-patch added

#5 @rachelbaker
10 years ago

  • Keywords ui-feedback dev-feedback added

#6 follow-up: @helen
10 years ago

While we're in here, what if we added a "Change role to" option to the bulk actions dropdown and only showed the role dropdown when that's selected (with JS on). It's a bulk action - seems awkward to have it separated like that in the first place, even though I can see why it went that way originally.

#7 in reply to: ↑ 6 @jeremyfelt
10 years ago

Replying to helen:

While we're in here, what if we added a "Change role to" option to the bulk actions dropdown and only showed the role dropdown when that's selected (with JS on). It's a bulk action - seems awkward to have it separated like that in the first place, even though I can see why it went that way originally.

I like that idea. Having one of the bulk actions broken out as an extra bulk action is weird.

It may seem a bit strange for changing the role for individual users as there is no "quick edit" for users. I almost don't want it to say "Bulk Actions", but just "Actions". Having another besides "Remove" would at least justify the plural. :)

Anyhow, +1 overall for seeing what merging the menus would feel like.

#8 @jeremyfelt
9 years ago

  • Focuses multisite added

#9 @wonderboymusic
9 years ago

In 34323:

List Tables: Ensure that sorting indicators have layout when cell widths are being calculated.

See #27743.

#10 @wonderboymusic
9 years ago

  • Milestone changed from Awaiting Review to 4.4
  • Owner set to wonderboymusic
  • Status changed from new to assigned

#11 @wonderboymusic
9 years ago

27743.2.diff is the first part of this

#12 @wonderboymusic
9 years ago

In 34636:

Users List Table: show the "Change role to" dropdown on the top and bottom. Currently only shows on top.

See #27743.

#13 @wonderboymusic
9 years ago

  • Keywords needs-patch added; has-patch ui-feedback dev-feedback removed
  • Milestone changed from 4.4 to Future Release
  • Owner wonderboymusic deleted

The rest of the ticket is folding into bulk actions

Note: See TracTickets for help on using tickets.