http://www.mediawiki.org/wiki/Special:Code/MediaWiki/100325

Revision: 100325
Author:   aaron
Date:     2011-10-20 02:26:59 +0000 (Thu, 20 Oct 2011)
Log Message:
-----------
Moved contribs rev parent ID batch query into doBatchLookups()

Modified Paths:
--------------
    trunk/phase3/includes/Pager.php
    trunk/phase3/includes/specials/SpecialContributions.php

Modified: trunk/phase3/includes/Pager.php
===================================================================
--- trunk/phase3/includes/Pager.php     2011-10-20 02:17:19 UTC (rev 100324)
+++ trunk/phase3/includes/Pager.php     2011-10-20 02:26:59 UTC (rev 100325)
@@ -388,8 +388,9 @@
        }
 
        /**
-        * 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
         */

Modified: trunk/phase3/includes/specials/SpecialContributions.php
===================================================================
--- trunk/phase3/includes/specials/SpecialContributions.php     2011-10-20 
02:17:19 UTC (rev 100324)
+++ trunk/phase3/includes/specials/SpecialContributions.php     2011-10-20 
02:26:59 UTC (rev 100325)
@@ -549,6 +549,18 @@
        }
 
        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 );
@@ -563,32 +575,6 @@
                }
        }
 
-       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
         */
@@ -609,6 +595,14 @@
                return $revLens;
        }
 
+       function getStartBody() {
+               return "<ul>\n";
+       }
+
+       function getEndBody() {
+               return "</ul>\n";
+       }
+
        /**
         * Generates each row in the contributions list.
         *


_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to