Skip to content

Commit c2bc4df

Browse files
Revisions: Address PHP/JS errors when viewing autosave on imported posts.
Fix an issue where viewing an autosave created on a post without any previous revisions would throw a PHP notice. Also fixes the revision screen which was broken in these cases and showed a console error. Props iseulde. Fixes #31249. git-svn-id: https://develop.svn.wordpress.org/trunk@50128 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 729bb10 commit c2bc4df

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/wp-admin/includes/revision.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ function wp_prepare_revisions_for_js( $post, $selected_revision_id, $from = null
281281
$revisions[ $post->ID ] = array(
282282
'id' => $post->ID,
283283
'title' => get_the_title( $post->ID ),
284-
'author' => $authors[ $post->post_author ],
284+
'author' => $authors[ $revision->post_author ],
285285
'date' => date_i18n( __( 'M j, Y @ H:i' ), strtotime( $post->post_modified ) ),
286286
'dateShort' => date_i18n( _x( 'j M @ H:i', 'revision date short format' ), strtotime( $post->post_modified ) ),
287287
/* translators: %s: Human-readable time difference. */

0 commit comments

Comments
 (0)