Use correct variable in UserCache::doQuery
authorumherirrender <umherirrender_de.wp@web.de>
Sat, 11 Jul 2015 10:19:35 +0000 (12:19 +0200)
committerUmherirrender <umherirrender_de.wp@web.de>
Sat, 11 Jul 2015 10:22:32 +0000 (10:22 +0000)
The variable $row is set to the last user of the first loop.
It is better to use the $name which is set in the foreach correctly.
This now adds all userpages to the LinkBatch and that avoids some extra
queries on at least Special:ListFiles.

Change-Id: Ied378b1596ec9d38eda41ce5ee413203c65eb21b

includes/cache/UserCache.php

index 2a3aac2..51bf385 100644 (file)
@@ -123,11 +123,11 @@ class UserCache {
                $lb = new LinkBatch();
                foreach ( $usersToCheck as $userId => $name ) {
                        if ( $this->queryNeeded( $userId, 'userpage', $options ) ) {
-                               $lb->add( NS_USER, $row->user_name );
+                               $lb->add( NS_USER, $name );
                                $this->typesCached[$userId]['userpage'] = 1;
                        }
                        if ( $this->queryNeeded( $userId, 'usertalk', $options ) ) {
-                               $lb->add( NS_USER_TALK, $row->user_name );
+                               $lb->add( NS_USER_TALK, $name );
                                $this->typesCached[$userId]['usertalk'] = 1;
                        }
                }