Make WordPress Core

Opened 17 months ago

Closed 16 months ago

Last modified 16 months ago

#22708 closed defect (bug) (fixed)

Post edit page may become almost unusable and textarea cannot be resized

Reported by: knutsp Owned by: azaozz
Milestone: 3.5 Priority: normal
Severity: normal Version: 3.5
Component: Editor Keywords: has-patch commit
Focuses: Cc:


I have seen a two cases where the edit page (post/page) has been practically unusable because the height of the editor textarea (and TinyMCE). It has become so large that it no longer can be adjusted back to normal by dragging the bottom corner. This is because this bottom is then somewhere thousands of screen heights scrolling down, if at all available (Firefox chokes).

All meta boxes in the main column was of course also inaccessible for both using and moving. No way to rectify this for the end user.

Inspecting table usermeta, meta_key user_settings for the actual user_id, variable ed_size, I could see a 9 or 10 digit large number (max_int?) stored. Setting this to 10 manually resolved the problem.

I have no idea how this value may become so big, but it happened using Firefox and WordPress 3.5 RC2.

This value needs to sanitized before saving, I think. Find a reasonable max value no one ever, on any kind of screen, need larger.

This is probably a regression, and came with the new way of setting the size of the text editor, discussed in #21718.

Attachments (2)

22708.patch (2.2 KB) - added by azaozz 17 months ago.
22708-2.patch (2.2 KB) - added by azaozz 17 months ago.

Download all attachments as: .zip

Change History (23)

comment:1 knutsp17 months ago

  • Version set to trunk

comment:2 usermrpapa17 months ago

had this happen to a couple of users too on RC 2... for one, we tracked this down:

ed_size was 17895699

tried resetting that value in db, but it came back... had to have users log out, delete their cookies and remove the user settings in database...

comment:3 nacin17 months ago

I agree, we should probably set a max of a few thousand. But that value does point to a bug. 17895699 is in pixels, and sounds like there's gotta be some math problem somewhere.

comment:4 follow-up: azaozz17 months ago

Confirmed to happen sometimes after zooming in (and out) in Firefox. Looks like a bug in FF (or jQuery?) as jQuery('#wp-content-editor-container').height() is about 17895699, +/- few px.

Patch coming up.

comment:5 in reply to: ↑ 4 knutsp17 months ago

Replying to azaozz:

Confirmed to happen sometimes after zooming in (and out) in Firefox. Looks like a bug in FF (or jQuery?) as jQuery('#wp-content-editor-container').height() is about 17895699, +/- few px.

I can, almost certainly, confirm that 17895699 was the value I saw in the database, both times. Just forgot to take a note of it.

Patch coming up.

Thank you. This kind of quick and firm response (nacin,azaozz) is what makes it really worth while reporting a bug, even if I am not able to submit a patch myself. Awesome!

azaozz17 months ago

comment:6 azaozz17 months ago

In 22708.patch​:

  • Set a sanity limit for editor height of 3000px (max screen height currently is 1440px).
  • Don't save the height when switching Text->Visual and back. Save only when resizing either the Text or the Visual editor.

comment:7 knutsp17 months ago

  • Keywords has-patch added; needs-patch removed

If I was able to reproduce the problem consistently I would like to test this patch. I have asked the users who experienced this if they occasionally do a resize in Firefox when in the edit page, and they both do, sometimes. So I guess there is a bug in Firefox, really.

Still trying, and will report back.

azaozz17 months ago

comment:8 azaozz17 months ago

22708-2.patch: bumps the max editor height to 5000px.

comment:9 nacin17 months ago

  • Keywords commit added

comment:10 knutsp17 months ago

Milestone 3.5? It's a kind of regression, so I had a hope for 3.5.

comment:11 azaozz17 months ago

  • Milestone changed from Awaiting Review to 3.5

comment:12 azaozz17 months ago

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

In 23016:

Editor: add sanity limit for editor height of 5000px, save only when resizing the Visual or the Text editor, fixes #22708

comment:13 azaozz17 months ago

In 23017:

5000, not 3000, see #22708

comment:14 beerpulse16 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

This isn't fixed? (Please forgive / I'm a publisher, not so much a developer).

Using Wordpress 3.5 stable. Verified that this is both the case in latest stable builds of both Chrome & Firefox.

Resizing this does nothing as it reverts back on refresh and/or save/update/publish.

Screenshot proof: http://www.webpagescreenshot.info/img/472374-12182012120702AM

comment:15 beerpulse16 months ago

Actually hitting 'publish' on a post after resizing did fix it. Still a bug present here though as it got to that size somehow in the first place, certainly not intentionally by my own doing.

Edit: looks like it isn't isolated to just me either. From two days ago: http://wordpress.org/support/topic/textvisual-editor-defaults-to-larger-than-screen-size-vertically

Last edited 16 months ago by beerpulse (previous) (diff)

comment:16 SergeyBiryukov16 months ago

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

This ticket was closed on a completed milestone. Please open a new one.

comment:17 kinderr@…16 months ago

  • Keywords needs-patch added; has-patch removed
  • Resolution fixed deleted
  • Severity changed from normal to major
  • Status changed from closed to reopened

Please change the resolution status to Reopen because this bug happens in Wordpress 3.5 with FireFox 17.0.1 and Chrome on Win7: http://wordpress.org/support/topic/the-option-to-change-the-size-of-editor-is-missing-how-to-change-the-size

After reading this thread, I fired up PhpMyAdmin and browsed the wp_usermeta table. The field wp_user-settings has the value ed_size=181566666&editor=tinymce.

I changed value to "ed_size=600&editor=tinymce", then open FireFox and signed into the WP Admin Dashboard and edited a post. The post editor box was the default normal size. Updating the post blew up the posted editor box. Checking wp_usermeta -> wp_user-settings showed "ed_size=33339999997615814&editor=tinymce&mfold=f".

I made sure the browsers were set to accept and keep all cookies. I do see a cookie:
Name: wp-settings-58
Content: ed_size%3D33339999997615814%26editor%3Dtinymce%26mfold%3Df

Which confirms the ed_size blow-up is being saved in the cookie.

Repeating the process in Chrome v23.0.1271.97 m reveals similar results, although the ed_size value will change to a different huge value if the post box is manually resized.

This bug makes it really time consuming to edit posts because the editor toolbar is way off the screen.

Thanks for looking into this.

comment:18 helen16 months ago

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

Please open a new ticket, as this one was closed on a completed milestone.

comment:19 kinderr@…16 months ago

My bad - I'm a publisher and didn't read deeply enough to recognize the fix is at http://core.trac.wordpress.org/changeset/23016.

I'll try out the patch files on my staging environment.


comment:20 SergeyBiryukov16 months ago

  • Keywords has-patch added; needs-patch removed
  • Severity changed from major to normal
Note: See TracTickets for help on using tickets.