[wp-trac] [WordPress Trac] #25416: "Preview Changes" throws a PHP Notice and Warning every second use

WordPress Trac noreply at wordpress.org
Tue Jan 28 11:47:52 UTC 2014


#25416: "Preview Changes" throws a PHP Notice and Warning every second use
--------------------------+------------------------------
 Reporter:  crysman       |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Autosave      |     Version:  3.6.1
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+------------------------------
Changes (by kovshenin):

 * keywords:  reporter-feedback => has-patch


Comment:

 I was able to reproduce this in trunk.

 > however $new_autosave does contain the post_excerpt field

 This is true, except when the current post type does not support excerpts,
 such as the page post type. I guess with CPT this will also affect the
 content and title fields, since the first time
 `_wp_post_revision_fields()` returns off of the posted data, but the loop
 runs on a clean call to `_wp_post_revision_fields`, referencing fields
 that might not exist in `$new_autosave`.

 It's fairly tricky to reproduce, but give it a shot like this:

 1. Turn on WP_DEBUG_LOG and watch wp-content/debug.log
 1. Create a new page, name it "foo", type in "bar" as the content and hit
 Publish
 1. Set the content to "bar baz" and hit Preview Changes (don't Publish)
 1. Set the content back to "bar" and hit Preview Changes again
 1. See debug.log

 Introduced in [24879], suggested fix in [attachment:25416.diff​]. Thoughts
 on moving this to 3.8.2 or 3.9?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/25416#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list