[wp-trac] [WordPress Trac] #45768: Content before editing are displayed in the preview

WordPress Trac noreply at wordpress.org
Thu Jan 31 10:23:36 UTC 2019


#45768: Content before editing are displayed in the preview
--------------------------+------------------------------
 Reporter:  tmatsuur      |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Editor        |     Version:
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by aaemnnosttv):

 From what I can see the problem is with this request:

 `POST /wp-admin/post.php?post=299&action=edit&meta-box-
 loader=1&_wpnonce=a537ca4521&_locale=user`

 The `action` in the POST request body is actually `editpost` which takes
 precedence over the `action=edit` in the query string since it is a POST
 request. This action performs a different function in `wp-admin/post.php`,
 which invokes `edit_post()` instead of simply loading the editor (and in
 turn meta boxes in this case).

 This triggers the post modified date of the post to be updated and causes
 the autosave required for the preview to be deleted when its modified date
 is compared to its parent. By the time the preview loads, the autosave may
 be deleted but I've seen it get created again in the background which
 makes this into a bit of a nasty race condition.

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


More information about the wp-trac mailing list