Merge "Mark constructors of IndexPager subclasses as public"
[lhc/web/wiklou.git] / includes / specials / pagers / ImageListPager.php
index 861011e..3ddbe08 100644 (file)
@@ -134,7 +134,16 @@ class ImageListPager extends TablePager {
                $conds = [];
 
                if ( !is_null( $this->mUserName ) ) {
-                       $conds[$prefix . '_user_text'] = $this->mUserName;
+                       // getQueryInfoReal() should have handled the tables and joins.
+                       $dbr = wfGetDB( DB_REPLICA );
+                       $actorWhere = ActorMigration::newMigration()->getWhere(
+                               $dbr,
+                               $prefix . '_user',
+                               User::newFromName( $this->mUserName, false ),
+                               // oldimage doesn't have an index on oi_user, while image does. Set $useId accordingly.
+                               $prefix === 'img'
+                       );
+                       $conds[] = $actorWhere['conds'];
                }
 
                if ( $this->mSearch !== '' ) {
@@ -413,7 +422,7 @@ class ImageListPager extends TablePager {
                }
        }
 
-       function doBatchLookups() {
+       protected function doBatchLookups() {
                $userIds = [];
                $this->mResult->seek( 0 );
                foreach ( $this->mResult as $row ) {