[wp-trac] [WordPress Trac] #21858: Auto Save Does Not Work

WordPress Trac wp-trac at lists.automattic.com
Tue Sep 11 21:14:33 UTC 2012


#21858: Auto Save Does Not Work
---------------------------+------------------------------
 Reporter:  miqrogroove    |       Owner:
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Autosave       |     Version:  3.4.2
 Severity:  blocker        |  Resolution:
 Keywords:  needs-testing  |
---------------------------+------------------------------
Changes (by miqrogroove):

 * keywords:  needs-patch needs-testing => needs-testing


Comment:

 Debug Findings
  Algorithmic Faults:
   wp-admin/includes/post.php @ 161

    post_date_gmt is the wrong field for checking when the last save
 occurred.

    ($now - $then) is missing a call to abs(). $then may be larger than
 $now, causing the return condition to be true.

  Flow of Control Faults:
   wp-admin/includes/post.php @ 168

    The function edit_post() fails at this point for all scheduled posts
 and returns to function wp_ajax_autosave().

   wp-admin/includes/ajax-actions.php @ 1091

    Function wp_ajax_autosave() assigns the return value to $id on the
 assumption that the post was already saved, and performs no relevant
 checks for success or failure before sending the "Draft saved at" ajax
 response to the client.

 Code History

  The ($now - $then) phrase exists in post.php as far back as version 2.3.

  I was able to reproduce the autosave failure in version 2.5.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/21858#comment:8>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list