Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#24921 closed defect (bug) (fixed)

Once the admin menu is collapsed, the user setting gets stuck on collapsed

Reported by: drewapicture's profile DrewAPicture Owned by: azaozz's profile azaozz
Milestone: 3.6.1 Priority: normal
Severity: normal Version: 3.5
Component: Administration Keywords: has-patch commit
Focuses: Cc:


Seems like once you collapse the admin menu and the mfold user setting is set, it doesn't ever get unset. I'm seeing this in the 3.6 branch and the 3.6 package shipped today.

I tried to trace it back to any recent changes made but I couldn't find anything. Tested in FF, Chrome and Safari on local and on a server.

Works as expected in trunk.

To reproduce:

  1. In the Dashboard, collapse the admin menu
  2. Refresh. Expected: Collapsed, Actual: Collapsed.
  3. Expand the menu.
  4. Refresh. Expected: Expanded, Actual: Collapsed.

Attachments (6)

24921.patch (756 bytes) - added by SergeyBiryukov 11 years ago.
24921.2.patch (2.1 KB) - added by azaozz 11 years ago.
24921.3.patch (7.0 KB) - added by azaozz 11 years ago.
24921.4.patch (7.1 KB) - added by azaozz 11 years ago.
24921.diff (15.7 KB) - added by nacin 11 years ago.
24921.2.diff (15.6 KB) - added by nacin 11 years ago.

Download all attachments as: .zip

Change History (22)

#1 @knutsp
11 years ago

Tried to reproduce this with Firefox 22 and Chrome 28, on both LAMP and WIMP installations running WP 3.6 (auto upgraded from 3.5.2). Could not reproduce.

#2 @azaozz
11 years ago

Works properly here. The only recent change to this was in [24619] (#23817) as WebKit calculates the body width differently for @media css rules when there is a vertical scrollbar.

Perhaps try getUserSetting('mfold') and deleteUserSetting('mfold') from the console at different window widths.

#3 @ocean90
11 years ago

Could reproduce it on a clean install. The setting is cleared from the cookie, but get_user_setting('mfold') in admin-header.php still returns 'f'.

#4 @SergeyBiryukov
11 years ago

Looks like [21574] brought back #18091.

deleteUserSetting() doesn't work as expected if the current cookie is empty.

#5 @SergeyBiryukov
11 years ago

24921.patch is the same fix as in [19091].

#6 @helen
11 years ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 3.6.1

11 years ago

#7 @azaozz
11 years ago

24921.2.patch fixes updating the user option when the cookie is empty. May not be suitable for a dot release as it changes the behaviour a bit, but it will fix all user settings not just 'mfold'.

A workaround for new installs is to change another user-state setting, for example resize the editor or switch Visual => Text and back.

Version 1, edited 11 years ago by azaozz (previous) (next) (diff)

11 years ago

#8 @azaozz
11 years ago

24921.3.patch​ is same as 24921.2.patch​ plus:

  • Use get_current_user_id() instead of wp_get_current_user() as only the user ID is needed.
  • Use is_user_member_of_blog().
  • Some cleanup of var names, erc.

11 years ago

#9 @azaozz
11 years ago

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

In 25109:

User state settings:

  • Allow empty cookie value to be saved.
  • Use get_current_user_id() instead of wp_get_current_user().
  • Use is_user_member_of_blog().
  • Sanitize both name and value in wp_set_all_user_settings().
  • Some var names and code formatting cleanup.

Fixes #24921.

#10 @helen
11 years ago

I had put this in 3.6.1 but I guess it was introduced in 3.5?

#11 @azaozz
11 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Yeah, was just going to reopen it for 3.6.1. This hasn't been working properly for ages, introduced probably in 2.8-2.9.

It makes difference only on brand new installs. As soon as the user switches Visual => Text or resizes the editor, the cookie is not empty any more and folding/unfolding works as expected. Not sure if a subset from the patch should go in 3.6.1. It's not a regression in 3.6.

#12 @SergeyBiryukov
11 years ago

  • Version changed from 3.6 to 3.5

It was a regression in 3.5, see comment:4.

#13 @nacin
11 years ago

  • Keywords commit added; dev-feedback removed

Let's do 24921.patch for 3.6.1. Per IRC with duck_, "Not a 3.6 regression, but it only affects new installs so would be good to have fixed in the lastest package".

#14 @SergeyBiryukov
11 years ago

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

In 25185:

Fix menu folding on new installs. fixes #24921 for 3.6.

#15 @azaozz
11 years ago

In 25186:

Fix folding/unfolding of the admin menu on new installs, props SergeyBiryukov, fixes #24921 for 3.6.1.

#16 @azaozz
11 years ago

[25186] adds the fix from [25185] to trunk to keep it in sync.

11 years ago

11 years ago

Note: See TracTickets for help on using tickets.