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 );
$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 !== '' ) {
}
}
- function doBatchLookups() {
+ protected function doBatchLookups() {
$userIds = [];
$this->mResult->seek( 0 );
foreach ( $this->mResult as $row ) {
if ( $thumb ) {
return $thumb->toHtml( [ 'desc-link' => true ] );
} else {
- return wfMessage( 'thumbnail_error', '' )->escaped();
+ return $this->msg( 'thumbnail_error', '' )->escaped();
}
} else {
return htmlspecialchars( $value );