[wp-trac] [WordPress Trac] #31249: PHP notice when viewing autosave

WordPress Trac noreply at wordpress.org
Thu Jan 28 21:12:50 UTC 2021


#31249: PHP notice when viewing autosave
--------------------------+------------------------------
 Reporter:  iseulde       |       Owner:  adamsilverstein
     Type:  defect (bug)  |      Status:  assigned
 Priority:  normal        |   Milestone:  5.7
Component:  Revisions     |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+------------------------------

Comment (by adamsilverstein):

 This is still reproducible and was also reported to me by another user.

 It can easily happen when you:
 * import posts into WordPress (for example the test data @iseulde
 mentioned) and then
 * trigger an autosave  by making a small edit and waiting until the
 autosave triggers, then
 * Reload the post and click the link to "View the Autosave".

 Because the post is imported, the expected "initial" post revision is
 missing. Revisions takes care of this, but a bug meant the "author" it
 tried to use did not exist. We can just use the revision author here
 instead.

 [attachment:"31249.diff"] fixes the issue.


 Before this fix, I also saw a JavaScript error viewing these autosaves,
 after the fix the screen worked as expected.

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


More information about the wp-trac mailing list