}
function doBatchLookups() {
- $this->mResult->rewind();
- $revIds = array();
- foreach ( $this->mResult as $row ) {
- if( isset( $row->rev_parent_id ) && $row->rev_parent_id ) {
- $revIds[] = $row->rev_parent_id;
- }
- }
- $this->mParentLens = Revision::getParentLengths( $this->getDatabase(), $revIds );
- $this->mResult->rewind(); // reset
-
# Do a link batch query
$this->mResult->seek( 0 );
+ $revIds = array();
$batch = new LinkBatch();
# Give some pointers to make (last) links
foreach ( $this->mResult as $row ) {
+ if( isset( $row->rev_parent_id ) && $row->rev_parent_id ) {
+ $revIds[] = $row->rev_parent_id;
+ }
if ( isset( $row->rev_id ) ) {
if ( $this->contribs === 'newbie' ) { // multiple users
$batch->add( NS_USER, $row->user_name );
$batch->add( $row->page_namespace, $row->page_title );
}
}
+ $this->mParentLens = Revision::getParentLengths( $this->getDatabase(), $revIds );
$batch->execute();
$this->mResult->seek( 0 );
}