Opened 2 years ago

Closed 2 years ago

#16348 closed defect (bug) (fixed)

Dashboard widget preferences not being honored

Reported by: kpdesign Owned by:
Priority: normal Milestone: 3.1
Component: Network Admin Version: 3.1
Severity: normal Keywords: has-patch
Cc: kparsell-wp@…

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 2 years ago.
16348.patch (568 bytes) - added by SergeyBiryukov 2 years ago.

Download all attachments as: .zip

Change History (10)

  • Milestone changed from Awaiting Review to 3.1

Related: #16238

It's happened:

Quote by 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.

Last edited 2 years ago by ocean90 (previous) (diff)

Oh man. Ryan's instincts trumped mine there.

  • Cc kparsell-wp@… added

Do we have something like this?

function add_suffix_once( $string, $suffix ) {
   return preg_replace( '#' . preg_quote( $suffix, '#' ) . '$#', '', $string ) . $suffix;
}
  • Keywords has-patch added; network-admin-dashboard removed

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

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