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
$lb = new LinkBatch();
foreach ( $usersToCheck as $userId => $name ) {
if ( $this->queryNeeded( $userId, 'userpage', $options ) ) {
$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 ) ) {
$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;
}
}
$this->typesCached[$userId]['usertalk'] = 1;
}
}