}
/**
- * Called from getBody(), before getStartBody() is called. This
- * will be called even if there are no rows in the result set.
+ * Called from getBody(), before getStartBody() is called and
+ * after doQuery() was called. This will be called even if there
+ * are no rows in the result set.
*
* @return void
*/
}
function doBatchLookups() {
+ global $wgRCShowChangedSize;
+
+ $this->mParentLens = array();
+ if ( $wgRCShowChangedSize ) {
+ $this->mResult->rewind();
+ $revIds = array();
+ foreach ( $this->mResult as $row ) {
+ $revIds[] = $row->rev_parent_id;
+ }
+ $this->mParentLens = $this->getParentLengths( $revIds );
+ $this->mResult->rewind(); // reset
+ }
if ( $this->contribs === 'newbie' ) { // multiple users
# Do a link batch query
$this->mResult->seek( 0 );
}
}
- function getStartBody() {
- return "<ul>\n";
- }
-
- function getEndBody() {
- return "</ul>\n";
- }
-
- function getBody() {
- global $wgRCShowChangedSize;
- if( !$this->mQueryDone ) {
- $this->doQuery();
- }
- $this->mParentLens = array();
- if( $wgRCShowChangedSize ) {
- $this->mResult->rewind();
- $revIds = array();
- foreach( $this->mResult as $row ) {
- $revIds[] = $row->rev_parent_id;
- }
- $this->mParentLens = $this->getParentLengths( $revIds );
- $this->mResult->rewind();
- }
- return parent::getBody();
- }
-
/*
* Do a batched query to get the parent revision lengths
*/
return $revLens;
}
+ function getStartBody() {
+ return "<ul>\n";
+ }
+
+ function getEndBody() {
+ return "</ul>\n";
+ }
+
/**
* Generates each row in the contributions list.
*