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
This commit is contained in:
Peter Westwood 2013-02-28 16:10:45 +00:00
parent 23e05a6301
commit 5133b4990b
2 changed files with 5 additions and 5 deletions

View File

@ -2140,7 +2140,7 @@ function wp_ajax_revisions_data() {
$compareto = isset( $_GET['compareto'] ) ? absint( $_GET['compareto'] ) : 0; $compareto = isset( $_GET['compareto'] ) ? absint( $_GET['compareto'] ) : 0;
$showautosaves = isset( $_GET['showautosaves'] ) ? $_GET['showautosaves'] : ''; $showautosaves = isset( $_GET['showautosaves'] ) ? $_GET['showautosaves'] : '';
$show_split_view = isset( $_GET['show_split_view'] ) ? $_GET['show_split_view'] : ''; $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; $comparetwomode = ( '' == $postid ) ? false : true;
// //
@ -2149,7 +2149,6 @@ function wp_ajax_revisions_data() {
//so only the possible diffs need be generated //so only the possible diffs need be generated
// //
$alltherevisions = array(); $alltherevisions = array();
if ( '' == $postid ) if ( '' == $postid )
$postid = $compareto; $postid = $compareto;
@ -2159,6 +2158,7 @@ function wp_ajax_revisions_data() {
if ( ! $revisions = wp_get_post_revisions( $postid ) ) if ( ! $revisions = wp_get_post_revisions( $postid ) )
return; return;
//if we are comparing two revisions, the first 'revision' represented by the leftmost //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 //slider position is the current revision, prepend a comparison to this revision
if ( $comparetwomode ) if ( $comparetwomode )

View File

@ -112,7 +112,7 @@ window.wp = window.wp || {};
self._right_handle_revisions.url = self._right_handle_revisions.url =
ajaxurl + ajaxurl +
'?action=revisions-data&compareto=' + wpRevisionsSettings.post_id + '?action=revisions-data&compareto=' + wpRevisionsSettings.post_id +
'&wpRevisionsSettings.post_id=' + wpRevisionsSettings.post_id + '&post_id=' + wpRevisionsSettings.post_id +
'&showautosaves=' + self._autosaves + '&showautosaves=' + self._autosaves +
'&showsplitview=' + self._showsplitview + '&showsplitview=' + self._showsplitview +
'&nonce=' + wpRevisionsSettings.nonce; '&nonce=' + wpRevisionsSettings.nonce;
@ -120,7 +120,7 @@ window.wp = window.wp || {};
self._right_handle_revisions.url = self._right_handle_revisions.url =
ajaxurl + ajaxurl +
'?action=revisions-data&compareto=' + self._revisions.at( self._left_diff - 1 ).get( 'ID' ) + '?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 + '&showautosaves=' + self._autosaves +
'&showsplitview=' + self._showsplitview + '&showsplitview=' + self._showsplitview +
'&nonce=' + wpRevisionsSettings.nonce; '&nonce=' + wpRevisionsSettings.nonce;
@ -129,7 +129,7 @@ window.wp = window.wp || {};
self._left_handle_revisions.url = self._left_handle_revisions.url =
ajaxurl + ajaxurl +
'?action=revisions-data&compareto=' + self._revisions.at( self._right_diff - 1 ).get( 'ID' ) + '?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 + '&showautosaves=' + self._autosaves +
'&showsplitview=' + self._showsplitview + '&showsplitview=' + self._showsplitview +
'&nonce=' + wpRevisionsSettings.nonce; '&nonce=' + wpRevisionsSettings.nonce;