r42758 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r42757‎ | r42758 | r42759 >
Date:04:17, 29 October 2008
Author:aaron
Status:old
Tags:
Comment:
Don't show orphaned revisions (will matter for bug 11402 later)
Modified paths:
  • /trunk/phase3/includes/api/ApiPageSet.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryRevisions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiPageSet.php
@@ -457,9 +457,9 @@
458458 $pageids = array();
459459 $remaining = array_flip($revids);
460460
461 - $tables = array('revision');
 461+ $tables = array('revision','page');
462462 $fields = array('rev_id','rev_page');
463 - $where = array('rev_deleted' => 0, 'rev_id' => $revids);
 463+ $where = array('rev_deleted' => 0, 'rev_id' => $revids,'rev_page = page_id');
464464
465465 // Get pageIDs data from the `page` table
466466 $this->profileDBIn();
Index: trunk/phase3/includes/api/ApiQueryRevisions.php
@@ -100,6 +100,8 @@
101101
102102 $this->addTables('revision');
103103 $this->addFields( Revision::selectFields() );
 104+ $this->addTables( 'page' );
 105+ $this->addWhere('page_id = rev_page');
104106
105107 $prop = array_flip($prop);
106108
@@ -114,8 +116,6 @@
115117 $this->token = $token;
116118
117119 if ( !is_null($this->token) || ( $this->fld_content && $this->expandTemplates ) || $pageCount > 0) {
118 - $this->addTables( 'page' );
119 - $this->addWhere('page_id=rev_page');
120120 $this->addFields( Revision::selectPageFields() );
121121 }
122122

Status & tagging log