The query here is not used for the images to display, so the query must
not include all columns from the images table, because that is not used
The gallery itself will load the necessary information for the display
in separate queries
Bug: T227608
Change-Id: I70b0d1bcdc155c38d69b5dd52bf4e3898920ab76
function getQueryInfo() {
$opts = $this->opts;
$conds = [];
function getQueryInfo() {
$opts = $this->opts;
$conds = [];
- $imgQuery = LocalFile::getQueryInfo();
- $tables = $imgQuery['tables'];
- $fields = [ 'img_name', 'img_timestamp' ] + $imgQuery['fields'];
+ $actorQuery = ActorMigration::newMigration()->getJoin( 'img_user' );
+ $tables = [ 'image' ] + $actorQuery['tables'];
+ $fields = [ 'img_name', 'img_timestamp' ] + $actorQuery['fields'];
- $jconds = $imgQuery['joins'];
+ $jconds = $actorQuery['joins'];
$user = $opts->getValue( 'user' );
if ( $user !== '' ) {
$user = $opts->getValue( 'user' );
if ( $user !== '' ) {
'LEFT JOIN',
[
'ug_group' => $groupsWithBotPermission,
'LEFT JOIN',
[
'ug_group' => $groupsWithBotPermission,
- 'ug_user = ' . $imgQuery['fields']['img_user'],
+ 'ug_user = ' . $actorQuery['fields']['img_user'],
'ug_expiry IS NULL OR ug_expiry >= ' . $dbr->addQuotes( $dbr->timestamp() )
]
];
'ug_expiry IS NULL OR ug_expiry >= ' . $dbr->addQuotes( $dbr->timestamp() )
]
];
'JOIN',
[
'rc_title = img_name',
'JOIN',
[
'rc_title = img_name',
- 'rc_actor = ' . $imgQuery['fields']['img_actor'],
+ 'rc_actor = ' . $actorQuery['fields']['img_actor'],
'rc_timestamp = img_timestamp'
]
];
'rc_timestamp = img_timestamp'
]
];