$pageids = array();
$remaining = array_flip($revids);
- $tables = array('revision');
+ $tables = array('revision','page');
$fields = array('rev_id','rev_page');
- $where = array('rev_deleted' => 0, 'rev_id' => $revids);
+ $where = array('rev_deleted' => 0, 'rev_id' => $revids,'rev_page = page_id');
// Get pageIDs data from the `page` table
$this->profileDBIn();
$this->addTables('revision');
$this->addFields( Revision::selectFields() );
+ $this->addTables( 'page' );
+ $this->addWhere('page_id = rev_page');
$prop = array_flip($prop);
$this->token = $token;
if ( !is_null($this->token) || ( $this->fld_content && $this->expandTemplates ) || $pageCount > 0) {
- $this->addTables( 'page' );
- $this->addWhere('page_id=rev_page');
$this->addFields( Revision::selectPageFields() );
}