[wp-trac] [WordPress Trac] #24923: Quick Edit: Title, author, and post date blank/reset on save in IE8
WordPress Trac
noreply at wordpress.org
Fri Nov 1 04:54:17 UTC 2013
#24923: Quick Edit: Title, author, and post date blank/reset on save in IE8
-----------------------------+------------------
Reporter: Peter_Sc | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 3.8
Component: Quick/Bulk Edit | Version: 3.6
Severity: normal | Resolution:
Keywords: has-patch |
-----------------------------+------------------
Changes (by SergeyBiryukov):
* keywords: => has-patch
Comment:
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:
[source:tags/3.7.1/src/wp-admin/js/inline-edit-post.js#L122]
[source: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 [http://api.jquery.com/clone/
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.
[attachment:24923.patch] fixes the issue for me for both posts and
taxonomies.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/24923#comment:12>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list