ImageListPager: Actor migration for buildQueryConds()
[lhc/web/wiklou.git] / includes / specials / pagers / ImageListPager.php
index 75c2f77..bb4f0b3 100644 (file)
@@ -23,7 +23,7 @@
  * @ingroup Pager
  */
 use MediaWiki\MediaWikiServices;
-use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IResultWrapper;
 use Wikimedia\Rdbms\FakeResultWrapper;
 
 class ImageListPager extends TablePager {
@@ -134,7 +134,14 @@ 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 )
+                       );
+                       $conds[] = $actorWhere['conds'];
                }
 
                if ( $this->mSearch !== '' ) {
@@ -356,8 +363,8 @@ class ImageListPager extends TablePager {
         *
         * Note: This will throw away some results
         *
-        * @param ResultWrapper $res1
-        * @param ResultWrapper $res2
+        * @param IResultWrapper $res1
+        * @param IResultWrapper $res2
         * @param int $limit
         * @param bool $ascending See note about $asc in $this->reallyDoQuery
         * @return FakeResultWrapper $res1 and $res2 combined