From 5133b4990b07dcd4bd09e22de54d68f6961d79c7 Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Thu, 28 Feb 2013 16:10:45 +0000 Subject: [PATCH] Revisions: Fix up some bugs I introduced while reviewing the mega revisions patch - when comparing two historical revisions only one half of the diff would load See #23497 props adamsilverstein. git-svn-id: http://core.svn.wordpress.org/trunk@23508 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/ajax-actions.php | 4 ++-- wp-admin/js/revisions.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/wp-admin/includes/ajax-actions.php b/wp-admin/includes/ajax-actions.php index b9c7f13d84..7c1503def8 100644 --- a/wp-admin/includes/ajax-actions.php +++ b/wp-admin/includes/ajax-actions.php @@ -2140,7 +2140,7 @@ function wp_ajax_revisions_data() { $compareto = isset( $_GET['compareto'] ) ? absint( $_GET['compareto'] ) : 0; $showautosaves = isset( $_GET['showautosaves'] ) ? $_GET['showautosaves'] : ''; $show_split_view = isset( $_GET['show_split_view'] ) ? $_GET['show_split_view'] : ''; - $postid = isset( $_GET['postid'] ) ? absint( $_GET['postid'] ) : ''; + $postid = isset( $_GET['post_id'] ) ? absint( $_GET['post_id'] ) : ''; $comparetwomode = ( '' == $postid ) ? false : true; // @@ -2149,7 +2149,6 @@ function wp_ajax_revisions_data() { //so only the possible diffs need be generated // $alltherevisions = array(); - if ( '' == $postid ) $postid = $compareto; @@ -2159,6 +2158,7 @@ function wp_ajax_revisions_data() { if ( ! $revisions = wp_get_post_revisions( $postid ) ) return; + //if we are comparing two revisions, the first 'revision' represented by the leftmost //slider position is the current revision, prepend a comparison to this revision if ( $comparetwomode ) diff --git a/wp-admin/js/revisions.js b/wp-admin/js/revisions.js index 43fb1e9848..92f3ae68ca 100644 --- a/wp-admin/js/revisions.js +++ b/wp-admin/js/revisions.js @@ -112,7 +112,7 @@ window.wp = window.wp || {}; self._right_handle_revisions.url = ajaxurl + '?action=revisions-data&compareto=' + wpRevisionsSettings.post_id + - '&wpRevisionsSettings.post_id=' + wpRevisionsSettings.post_id + + '&post_id=' + wpRevisionsSettings.post_id + '&showautosaves=' + self._autosaves + '&showsplitview=' + self._showsplitview + '&nonce=' + wpRevisionsSettings.nonce; @@ -120,7 +120,7 @@ window.wp = window.wp || {}; self._right_handle_revisions.url = ajaxurl + '?action=revisions-data&compareto=' + self._revisions.at( self._left_diff - 1 ).get( 'ID' ) + - '&wpRevisionsSettings.post_id=' + wpRevisionsSettings.post_id + + '&post_id=' + wpRevisionsSettings.post_id + '&showautosaves=' + self._autosaves + '&showsplitview=' + self._showsplitview + '&nonce=' + wpRevisionsSettings.nonce; @@ -129,7 +129,7 @@ window.wp = window.wp || {}; self._left_handle_revisions.url = ajaxurl + '?action=revisions-data&compareto=' + self._revisions.at( self._right_diff - 1 ).get( 'ID' ) + - '&wpRevisionsSettings.post_id=' + wpRevisionsSettings.post_id + + '&post_id=' + wpRevisionsSettings.post_id + '&showautosaves=' + self._autosaves + '&showsplitview=' + self._showsplitview + '&nonce=' + wpRevisionsSettings.nonce;