Merge "Mark constructors of IndexPager subclasses as public"
[lhc/web/wiklou.git] / includes / specials / pagers / ImageListPager.php
index 3d7148d..3ddbe08 100644 (file)
@@ -50,7 +50,7 @@ class ImageListPager extends TablePager {
 
        protected $mTableName = 'image';
 
-       function __construct( IContextSource $context, $userName = null, $search = '',
+       public function __construct( IContextSource $context, $userName = null, $search = '',
                $including = false, $showAll = false
        ) {
                $this->setContext( $context );
@@ -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 ) {
@@ -449,7 +458,7 @@ class ImageListPager extends TablePager {
                                        if ( $thumb ) {
                                                return $thumb->toHtml( [ 'desc-link' => true ] );
                                        } else {
-                                               return wfMessage( 'thumbnail_error', '' )->escaped();
+                                               return $this->msg( 'thumbnail_error', '' )->escaped();
                                        }
                                } else {
                                        return htmlspecialchars( $value );