Index: trunk/phase3/includes/api/ApiPageSet.php |
— | — | @@ -457,9 +457,9 @@ |
458 | 458 | $pageids = array(); |
459 | 459 | $remaining = array_flip($revids); |
460 | 460 | |
461 | | - $tables = array('revision'); |
| 461 | + $tables = array('revision','page'); |
462 | 462 | $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'); |
464 | 464 | |
465 | 465 | // Get pageIDs data from the `page` table |
466 | 466 | $this->profileDBIn(); |
Index: trunk/phase3/includes/api/ApiQueryRevisions.php |
— | — | @@ -100,6 +100,8 @@ |
101 | 101 | |
102 | 102 | $this->addTables('revision'); |
103 | 103 | $this->addFields( Revision::selectFields() ); |
| 104 | + $this->addTables( 'page' ); |
| 105 | + $this->addWhere('page_id = rev_page'); |
104 | 106 | |
105 | 107 | $prop = array_flip($prop); |
106 | 108 | |
— | — | @@ -114,8 +116,6 @@ |
115 | 117 | $this->token = $token; |
116 | 118 | |
117 | 119 | if ( !is_null($this->token) || ( $this->fld_content && $this->expandTemplates ) || $pageCount > 0) { |
118 | | - $this->addTables( 'page' ); |
119 | | - $this->addWhere('page_id=rev_page'); |
120 | 120 | $this->addFields( Revision::selectPageFields() ); |
121 | 121 | } |
122 | 122 | |