Make WordPress Core

Opened 12 years ago

Closed 11 years ago

#24923 closed defect (bug) (fixed)

Quick Edit: Title, author, and post date blank/reset on save in IE8

Reported by: peter_sc's profile Peter_Sc Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 3.8 Priority: normal
Severity: major Version: 3.6
Component: Quick/Bulk Edit Keywords: has-patch commit
Focuses: Cc:

Description (last modified by ocean90)

Hi I am a bit of a newbie ,on WP but have been a beta tester in the past

In a fresh Local (wamp) install of 3.6 , I created a few pages to play with the menu layout and widgits etc and found that using the quick edit function on pages to allow or disallow comments , causes the page title to vanish and is renamed "Untitled"

I am assuming that this is "Not Planned" '-)

Peter

Attachments (1)

24923.patch (897 bytes) - added by SergeyBiryukov 12 years ago.

Download all attachments as: .zip

Change History (23)

#1 @ocean90
12 years ago

  • Description modified (diff)

#2 @johnbillion
12 years ago

  • Component changed from Editor to Quick/Bulk Edit
  • Keywords reporter-feedback added

Can't reproduce this on a fresh 3.6 install. Altering the comment status with Quick Edit isn't affecting the title for me.

Can you try to reproduce this with all your plugins disabled and the default theme active? Also please let us know which browser and OS you're using.

#3 @IanMayes
12 years ago

Had a similar issue with quick edit emptying content from posts via the dashboard quick edit but only in IE8. No problem in other browsers I have tested it in.

#4 follow-up: @c3mdigital
12 years ago

Another report of this issue on the support forums, http://wordpress.org/support/topic/my-posts-cant-be-edited-removes-title-and-auto-publishes?replies=1

Verification still needed using one of the default themes with all plugins disabled.

#5 in reply to: ↑ 4 @wmgtam
12 years ago

Replying to c3mdigital:

Another report of this issue on the support forums, http://wordpress.org/support/topic/my-posts-cant-be-edited-removes-title-and-auto-publishes?replies=1

Verification still needed using one of the default themes with all plugins disabled.

Adding another report -- "quick edit" on already published post to uncheck a category blanks out the title, resets the author to the first in the list, resets the publish date. Happened since update to 3.61 (skipped 3.6). We're on Zippykid hosting, running a customized version of TwentyTen. Plugins active include Akismet, AVH Extended Categories, Blubrry PowerPress, Gravity Forms, Jetpack, Simply Exclude, Use Google Libraries, Wordpress Editorial Calendar.

#6 follow-up: @helen
12 years ago

Can you please let us know which browser and OS you are using, and if you're up for testing, if it affects multiple browsers?

#7 in reply to: ↑ 6 @wmgtam
12 years ago

Replying to helen:

Can you please let us know which browser and OS you are using, and if you're up for testing, if it affects multiple browsers?

I just was able to replicate this on a completely different website I'm developing using WP 3.61 and NONE of the plugins on the other site.

Using WindowsXP/IE8, accessing "quick edit" on an already-published post and changing categories then saving deletes the title, resets the author to the default author, deletes all tags, and resets the published date to "now". Same site using "quick edit" from FF and Chrome(same computer), no errors.

So two different websites on different hosting providers with entirely different plugin sets, but using IE8 with "quick edit" has predictable results.

(edit) and Yes I'd be happy to test code somebody sends me on the site I'm in development on.

Last edited 12 years ago by wmgtam (previous) (diff)

#8 @helen
12 years ago

  • Keywords needs-testing reporter-feedback removed
  • Summary changed from Quick Edit > Page Title Vanishes to Quick Edit: Title, author, and post date blank/reset on save in IE8

Thanks for the details, wmgtam.

Would be good to know if this happens in 3.5 or earlier.

#9 @pavelevap
12 years ago

  • Cc pavelevap@… added

I can confirm this issue.

It is somehow related to IE8 (and also IE7, then there is not only title missing, but the whole row with post disappears). IE9 nad Chrome are OK.

I tried different OS (Windows 2008 Server + IIS 7.5 and Linux) and bug is everywhere in IE8 (and lower).

I also tried the same website on 3.5.2 (it was OK) and then updated to 3.6.1 (and it was broken). So, it is probably a regression. Problem is also on WP 3.6 version.

#10 @SergeyBiryukov
12 years ago

#25790 was marked as a duplicate.

#11 @SergeyBiryukov
12 years ago

  • Milestone changed from Awaiting Review to 3.8

Confirmed. Investigating.

then saving deletes the title, resets the author to the default author, deletes all tags, and resets the published date to "now".

In my case, the published date was reset to the date of the first page in the list.

#12 @SergeyBiryukov
12 years ago

  • Keywords has-patch added

Introduced in [24364] along with jQuery 1.10.

When Quick Edit link is clicked, we clone an empty table row and populate it with data:
tags/3.7.1/src/wp-admin/js/inline-edit-post.js#L122
tags/3.7.1/src/wp-admin/js/inline-edit-tax.js#L40

The issue here is that .clone() causes IE8 to duplicate the fields in the POST request on saving.

Firefox:
post_title=234&post_name=6716-2&mm=05&jj=15&aa=2013&hh=12&mn=19&ss=00&post_author=7&post_password=&post_parent=0&menu_order=0&page_template=default&_status=publish&_inline_edit=f454c83405&post_view=list&screen=edit-page&action=inline-save&post_type=page&post_ID=6716&edit_date=true&post_status=all

IE8:
post_title=234&post_name=6716-2&mm=05&jj=15&aa=2013&hh=12&mn=19&ss=00&post_author=7&post_password=&post_parent=0&menu_order=0&page_template=default&_status=publish&_inline_edit=f454c83405&post_view=list&screen=edit-page&post_title=&post_name=&mm=05&jj=15&aa=2013&hh=12&mn=19&ss=00&post_author=7&post_password=&post_parent=0&menu_order=0&page_template=default&_status=publish&_inline_edit=f454c83405&post_view=list&screen=edit-page&action=inline-save&post_type=page&post_ID=6716&edit_date=true&post_status=all

Note the empty instances of post_title and post_name.

I was able to reduce the test case to a simple fiddle: http://jsfiddle.net/SergeyBiryukov/vQNRa/. It displays post_title= in Firefox and post_title=&post_title= in IE8 (see http://stackoverflow.com/a/15268966 for running it in IE8).

This might have to do with the warning in jQuery API docs:

Note: Using .clone() has the side-effect of producing elements with duplicate id attributes, which are supposed to be unique. Where possible, it is recommended to avoid cloning elements with this attribute or using class attributes as identifiers instead.

The issue can be reproduced for taxonomies as well if you use Quick Edit twice there.

24923.patch fixes the issue for me for both posts and taxonomies.

#13 @azaozz
11 years ago

Interesting. At the moment of cloning, the ids are the same. Later in the same function the cloned row's id is changed. Much later when serializing the form data, the changed id is used. But in IE8 it pulls form fields from the source row (that has completely different id). Sounds like bad cache or IE8 messing up the DOM.

Btw, the clone code is exactly the same as one of the examples in the jQuery documentation (halfway down the page). Both select an element by id and then clone it :)

Seems best would be to avoid using ids on these table rows, but that might affect plugins that manipulate Quick Edit. For now the patch looks good.

#14 @HerrLlama
11 years ago

Srsly? 3.8 is way to far beyond the ballpark. We have several issues which leads to data loss. IMHO This ticket should be in the milestone 3.7.2

Edit: Patch works for me.

Last edited 11 years ago by HerrLlama (previous) (diff)

#15 @dnaber-de
11 years ago

  • Cc kontakt@… added

#16 @ocean90
11 years ago

  • Cc ocean90 added

#17 @SergeyBiryukov
11 years ago

  • Milestone changed from 3.8 to 3.7.2

Technically a regression in 3.6.

#18 @ocean90
11 years ago

Technically a regression in 3.6.

That's right. But we have a high risk of data lost which is a no-go.

Edit: Patch works for me.

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

#19 @SergeyBiryukov
11 years ago

  • Keywords commit added
  • Severity changed from normal to major

#20 @SergeyBiryukov
11 years ago

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

In 26123:

Change jQuery selector in Quick Edit to avoid losing data in IE8.

fixes #24923 for trunk.

#21 @SergeyBiryukov
11 years ago

  • Keywords fixed-major added
  • Resolution fixed deleted
  • Status changed from closed to reopened

#22 @nacin
11 years ago

  • Keywords fixed-major removed
  • Milestone changed from 3.7.2 to 3.8
  • Resolution set to fixed
  • Status changed from reopened to closed

Calling this fixed on 3.8.

Note: See TracTickets for help on using tickets.