WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#16348 closed defect (bug) (fixed)

Dashboard widget preferences not being honored

Reported by: kpdesign Owned by:
Milestone: 3.1 Priority: normal
Severity: normal Version: 3.1
Component: Network Admin Keywords: has-patch
Focuses: multisite Cc:

Description

On my dev Multisite install, I have set my preferences to only show the "Right Now" widget on the Network Admin screen. However, whenever I go to the Network Admin dashboard, all of the widgets are being displayed, regardless of what I've chosen (see screenshot).

I have to check all of the boxes, then uncheck them to make the other widgets disappear. Navigating away from the dashboard, then returning, all of the widgets are once again showing, and the checkboxes next to each one in the screen options panel are empty.

This only happens on the Network Admin dashboard; individual site dashboards retain their preferences properly.

Attachments (2)

wp3.1-network-admin-dashboard-issue.png (130.2 KB) - added by kpdesign 3 years ago.
16348.patch (568 bytes) - added by SergeyBiryukov 3 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 nacin3 years ago

  • Milestone changed from Awaiting Review to 3.1

comment:2 ocean903 years ago

Related: #16238

It's happened:

Replying to ryan:

Let's make sure we don't end up with -network-network if the passed string is already suffixed.


get_hidden_meta_boxes( $screen )

$screen is dashboard-network and through convert_to_screen() it becomes dashboard-network-network.

Version 0, edited 3 years ago by ocean90 (next)

comment:3 nacin3 years ago

Oh man. Ryan's instincts trumped mine there.

comment:4 kpdesign3 years ago

  • Cc kparsell-wp@… added

comment:5 markjaquith3 years ago

Do we have something like this?

function add_suffix_once( $string, $suffix ) {
   return preg_replace( '#' . preg_quote( $suffix, '#' ) . '$#', '', $string ) . $suffix;
}

SergeyBiryukov3 years ago

comment:6 SergeyBiryukov3 years ago

  • Keywords has-patch added; network-admin-dashboard removed

comment:7 kpdesign3 years ago

I've tested Sergey's patch on my dev install and it resolves the issue for me.

comment:8 markjaquith3 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [17356]) Make sure we don't double-add -user or -network suffixes in convert_to_screen(). props SergeyBiryukov. fixes #16348

Note: See TracTickets for help on using tickets.