WordPress.org

Make WordPress Core

Opened 22 months ago

Closed 21 months ago

Last modified 21 months ago

#24921 closed defect (bug) (fixed)

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

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

Description

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 22 months ago.
24921.2.patch (2.1 KB) - added by azaozz 22 months ago.
24921.3.patch (7.0 KB) - added by azaozz 22 months ago.
24921.4.patch (7.1 KB) - added by azaozz 21 months ago.
24921.diff (15.7 KB) - added by nacin 21 months ago.
24921.2.diff (15.6 KB) - added by nacin 21 months ago.

Download all attachments as: .zip

Change History (22)

comment:1 @knutsp22 months 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.

comment:2 @azaozz22 months 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.

comment:3 @ocean9022 months 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'.

comment:4 @SergeyBiryukov22 months ago

Looks like [21574] brought back #18091.

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

@SergeyBiryukov22 months ago

comment:6 @helen22 months ago

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

@azaozz22 months ago

comment:7 @azaozz22 months 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'.

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

Last edited 22 months ago by azaozz (previous) (diff)

@azaozz22 months ago

comment:8 @azaozz22 months 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.

@azaozz21 months ago

comment:9 @azaozz21 months 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.

comment:10 @helen21 months ago

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

comment:11 @azaozz21 months 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.

comment:12 @SergeyBiryukov21 months ago

  • Version changed from 3.6 to 3.5

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

comment:13 @nacin21 months 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".

comment:14 @SergeyBiryukov21 months ago

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

In 25185:

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

comment:15 @azaozz21 months ago

In 25186:

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

comment:16 @azaozz21 months ago

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

@nacin21 months ago

@nacin21 months ago

Note: See TracTickets for help on using tickets.