Make WordPress Core

Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#22708 closed defect (bug) (fixed)

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

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

Description

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 14 years ago.
22708-2.patch​ (2.2 KB ) - added by azaozz 14 years ago.

Download all attachments as: .zip

Change History (23)

#1 @knutsp
14 years ago

  • Version → trunk

#2 @usermrpapa
14 years 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...

#3 @nacin
14 years 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.

#4 follow-up: @azaozz
14 years 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.

#5 in reply to: ↑ 4 @knutsp
14 years 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!

#6 @azaozz
14 years 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.

#7 @knutsp
14 years 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.

#8 @azaozz
14 years ago

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

#9 @nacin
14 years ago

  • Keywords commit added

#10 @knutsp
14 years ago

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

#11 @azaozz
14 years ago

  • Milestone Awaiting Review → 3.5

#12 @azaozz
14 years ago

  • Owner set to azaozz
  • Resolution → fixed
  • Status new → closed

In 23016:

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

#13 @azaozz
14 years ago

In 23017:

5000, not 3000, see #22708

#14 @beerpulse
14 years ago

  • Resolution fixed
  • Status closed → 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

#15 @beerpulse
14 years 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 14 years ago by beerpulse (previous) (diff)

#16 @SergeyBiryukov
14 years ago

  • Resolution → fixed
  • Status reopened → closed

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

#17 @kinderr@…
14 years ago

  • Keywords needs-patch added; has-patch removed
  • Resolution fixed
  • Severity normal → major
  • Status closed → 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.

#18 @helen
14 years ago

  • Resolution → fixed
  • Status reopened → closed

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

#19 @kinderr@…
14 years 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.

Thanks

#20 @SergeyBiryukov
14 years ago

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