Make WordPress Core

Opened 6 years ago

Last modified 9 days ago

#31249 assigned defect (bug)

PHP notice when viewing autosave

Reported by: iseulde Owned by: adamsilverstein
Milestone: 5.7 Priority: normal
Severity: normal Version:
Component: Revisions Keywords: needs-patch
Focuses: Cc:


Notice: Undefined offset: 2 in wp-admin/includes/revision.php on line 223

This happens when you view an autosave without any previous revisions and the original author's role is not author anymore.

Change History (4)

#1 @adamsilverstein
6 years ago

  • Owner set to adamsilverstein
  • Status changed from new to assigned

@iseulde Thanks for the bug report!

I will look into this, can you clarify the steps to reproduce? is this right?

  • Open an existing post without previous revisions (the default hello post, or can you also create a new post?)
  • ensure autosave fires
  • change role to contributor
  • edit the post and go to revisions screen

#2 @iseulde
6 years ago

Those sound like good steps to reproduce the issue. This happened to me when I imported the theme unit test data. A post was autosaved (no revisions) and when I came back later and clicked on "view autosave", I save the notice. Very minor issue I guess.

#3 @adamsilverstein
6 years ago

Ok, thanks. Will investigate.

Revisions incorrectly makes the assumption that there is always a saved revision, which is true when creating new posts, but false after an import or on a new install (sample posts).

Related #29044

#4 @adamsilverstein
9 days ago

  • Milestone set to 5.7
Note: See TracTickets for help on using tickets.